Title: Dynamic Preview
Last modified: June 26, 2024

---

# Dynamic Preview

 *  Resolved [codinit](https://wordpress.org/support/users/codinit/)
 * (@codinit)
 * [1 year, 9 months ago](https://wordpress.org/support/topic/dynamic-preview/)
 * Hello everyone,
 * thank you very much for the great plugin! Unfortunately I still have difficulties
   with the Dynamic Preview:
 * In addition to the styles of the individual layouts, I use a main.css, which 
   contains general styles for e.g. font sizes, fonts etc.. I have integrated this
   main.css as follows:
 *     ```wp-block-code
       add_action('acfe/flexible/enqueue/name=content', 'my_acf_flexible_enqueue', 20, 2);function my_acf_flexible_enqueue($field, $is_preview){    wp_enqueue_style('main-styles', get_stylesheet_directory_uri() . '/assets/css/main.css');}
       ```
   
 * However, these font sizes are now overwritten by load-styles.php, so that the
   preview looks very different from the actual frontend. For example, this is what
   the overwriting from the load-styles.php of my h2 looks like:
 *     ```wp-block-code
       #poststuff .stuffbox>h3, #poststuff h2, #poststuff h3.hndle {  font-size: 14px;  padding: 8px 12px;  margin: 0;  line-height: 1.4;}
       ```
   
 * How can I configure the Dynamic Preview as accurately as possible without WordPress
   default styles overwriting my styles? Do I have to specifically dequeue WP styles?
 * Many thanks in advance and best regards
 * Lukas

Viewing 3 replies - 1 through 3 (of 3 total)

 *  Plugin Author [Konrad Chmielewski](https://wordpress.org/support/users/hwk-fr/)
 * (@hwk-fr)
 * [1 year, 9 months ago](https://wordpress.org/support/topic/dynamic-preview/#post-17852700)
 * Hello,
 * Thanks for the feedback!
 * I’m glad to hear you enjoy ACF Extended! 🙂
 * Unfortunately, there is no ideal solution for the WP Admin CSS compatibility 
   with the Flexible Content. As you pointed out, the most common issue come from
   the `#poststuff h2` css rule added by WP which is too broad. As far as I can 
   tell, it’s the only rule that really mess with generic tags.
 * I wouldn’t recommend to dequeue wp css files tho, as it might have unwanted side
   effects. The solution right now is to add a special rule for the preview mode
   to override, and reset, the `h2` to your convenience like this:
 *     ```wp-block-code
       -.preview h2{    font-size: 18px !important;    // reset h2 in preview}
       ```
   
 * Note that you can also enqueue a different stylesheet specifically for the preview
   mode to reset it, using the `$is_preview` argument provided in your `acfe/flexible/
   enqueue/name=content` hook.
 * In the future, there will a feature to enable an “isolated mode” for the Preview
   Mode, which will embed the preview inside an iframe, and get rid of any intrusive
   CSS rules.
 * You’ll find [another thread discussing this topic here](https://wordpress.org/support/topic/dynamic-render-dequeue-load-style/),
   with more technical details. It also include some proof of concept implementation
   for the “iframe mode”, if you want to try it.
 * Hope it helps!
 * Have a nice day!
 * Regards.
 *  Thread Starter [codinit](https://wordpress.org/support/users/codinit/)
 * (@codinit)
 * [1 year, 9 months ago](https://wordpress.org/support/topic/dynamic-preview/#post-17853531)
 * Thank you very much! I implemented your iframe-Snippet and it works great.
 *  Plugin Author [Konrad Chmielewski](https://wordpress.org/support/users/hwk-fr/)
 * (@hwk-fr)
 * [1 year, 9 months ago](https://wordpress.org/support/topic/dynamic-preview/#post-17854202)
 * Awesome!
 * Have a nice day!
 * Regards.

Viewing 3 replies - 1 through 3 (of 3 total)

The topic ‘Dynamic Preview’ is closed to new replies.

 * ![](https://ps.w.org/acf-extended/assets/icon-256x256.png?rev=2071550)
 * [Advanced Custom Fields: Extended](https://wordpress.org/plugins/acf-extended/)
 * [Frequently Asked Questions](https://wordpress.org/plugins/acf-extended/#faq)
 * [Support Threads](https://wordpress.org/support/plugin/acf-extended/)
 * [Active Topics](https://wordpress.org/support/plugin/acf-extended/active/)
 * [Unresolved Topics](https://wordpress.org/support/plugin/acf-extended/unresolved/)
 * [Reviews](https://wordpress.org/support/plugin/acf-extended/reviews/)

## Tags

 * [wordpress admin](https://wordpress.org/support/topic-tag/wordpress-admin/)

 * 3 replies
 * 2 participants
 * Last reply from: [Konrad Chmielewski](https://wordpress.org/support/users/hwk-fr/)
 * Last activity: [1 year, 9 months ago](https://wordpress.org/support/topic/dynamic-preview/#post-17854202)
 * Status: resolved