Skip to content

Theme editor styles (add_editor_style) not loaded in Site Editor “Styles” view and Template/Pattern preview iframes when Gutenberg plugin is active (WP 6.9.1 + GB 22.5.3) #75779

Closed

Description

@Azragh

Description

I’m using a hybrid theme with:

  • add_theme_support( 'editor-styles' )
  • add_editor_style( 'assets/css/editor.css' )

The editor styles apply correctly in the normal post/page block editor canvas.

However, when the Gutenberg plugin is active, my theme editor styles are not loaded in:

  1. Site Editor → Styles (“Stile”) / visual identity view (Style Book-like screen)
  2. Template / Pattern / Reusable block listing previews where each card uses a separate preview iframe

When I disable the Gutenberg plugin, the previews and the Styles screen iframes render correctly with the theme’s editor styles.

This looks like a regression or a missing integration in the Gutenberg plugin’s preview iframe/style pipeline for classic themes.

Step-by-step reproduction instructions

  1. Activate a classic theme that declares editor styles:
  2. add_theme_support( 'editor-styles' )
  3. add_editor_style( 'assets/css/editor.css' ) (contains typography/button styles etc.)

Go to Site Editor and open:

  • Appearance → Editor → Styles (visual identity / typography preview)
  • Templates / Patterns / reusable blocks grid where cards show preview thumbnails

Observe the preview rendering.

Disable Gutenberg plugin and repeat steps 2–3.

Screenshots, screen recording, code snippet

Without Gutenberg Plugin:

Image

With Gutenberg Plugin:

Image

Environment info

WordPress: 6.9.1
Gutenberg plugin: 22.5.3
Theme type: Classic theme using add_theme_support( 'editor-styles' ) + add_editor_style()
Browser: Chrome

Please confirm that you have searched existing issues in the repo.

  • Yes

Please confirm that you have tested with all plugins deactivated except Gutenberg.

  • Yes

Please confirm which theme type you used for testing.

  • Block
  • Classic
  • Hybrid (e.g. classic with theme.json)
  • Not sure

Activity

  1. added
    [Type] BugAn existing feature does not function as intended
    on Feb 20, 2026
  2. Azragh commented on Feb 20, 2026

    @Azragh
    Author

    Additional Screenshots

    Site editor Styles with Gutenberg plugin active:
    Image

    Site editor Styles with Gutenberg inactive:
    Image

  3. Azragh commented on Feb 20, 2026

    @Azragh
    Author

    may be related: #74081

  4. github-actions commented on Mar 29, 2026

    @github-actions
  5. added
    [Status] StaleGives the original author opportunity to update before closing. Can be reopened as needed.
    on Mar 29, 2026
  6. Azragh commented on Mar 31, 2026

    @Azragh
    Author

    Yes. Still relevant. Just updated the plugin to Version 22.8.2 and the issue persists.

    Gutenberg plugin active:

    Image Image

    Gutenberg plugin inactive, WP up to date:

    Image Image
  7. removed
    [Status] StaleGives the original author opportunity to update before closing. Can be reopened as needed.
    on Apr 1, 2026
  8. github-actions commented on May 1, 2026

    @github-actions
  9. added
    [Status] StaleGives the original author opportunity to update before closing. Can be reopened as needed.
    on May 1, 2026
  10. Azragh commented on May 1, 2026

    @Azragh
    Author

    Still relevant with plugin version 23.0.1. Still looks fine without plugin active. @Mamaduka could somebody please look into this? I'm worried this gets baked into core if nobody cares.

  11. added and removed
    [Status] StaleGives the original author opportunity to update before closing. Can be reopened as needed.
    on May 1, 2026
  12. t-hamano commented on May 4, 2026

    @t-hamano
    Contributor

    Could someone provide some theme data to reproduce this issue with a classic theme? Alternatively, can this issue be reproduced with a theme downloadable from the theme directory? At least, this issue cannot be reproduced with the default theme.

  13. 3 remaining items

  14. Azragh commented on May 5, 2026

    @Azragh
    Author

    @t-hamano Yes. As mentioned in the first line of the description I'm developing hybrid themes. As far as I observed, add_editor_style() simply does not apply the styles to the styles screen with Gutenberg active. No matter what. Even when I remove the theme.json from twentytwenty-four and enqueue my styles like above, they only apply without the plugin. The problem clearly has smth to do with the implementation of add_editor_style() in the plugin or how the theme support functionality works.

  15. changed the title [-]Classic theme editor styles (add_editor_style) not loaded in Site Editor “Styles” view and Template/Pattern preview iframes when Gutenberg plugin is active (WP 6.9.1 + GB 22.5.3)[/-] [+]Theme editor styles (add_editor_style) not loaded in Site Editor “Styles” view and Template/Pattern preview iframes when Gutenberg plugin is active (WP 6.9.1 + GB 22.5.3)[/+] on May 5, 2026
  16. t-hamano commented on May 5, 2026

    @t-hamano
    Contributor

    Thank you, I finally figured out how to reproduce the issue. It's very simple to reproduce the problem in a Gutenberg local environment.

    1. Make the following changes.
      diff --git a/test/emptytheme/style.css b/test/emptytheme/style.css
      index 74cd7d858ad..f1f36885a9b 100644
      --- a/test/emptytheme/style.css
      +++ b/test/emptytheme/style.css
      @@ -13,3 +13,7 @@ Text Domain: emptytheme
       Emptytheme WordPress Theme, (C) 2021 WordPress.org
       Emptytheme is distributed under the terms of the GNU GPL.
       */
      +
      +p {
      +       background-color: red !important;
      +}
    2. Activate Emptytheme. This theme already has the following code.
      add_editor_style( 'style.css' );
    3. Create a pattern that includes paragraph blocks.
    4. Access the Patterns page.
    WordPress 6.9 WordPress 7.0 RC2 or Gutenberg plugin enabled
    Image Image

    In other words, this is a regression that will occur in WordPress 7.0. Let's identify and fix the problem.

  17. added
    [Type] RegressionRelated to a regression in the latest release
    and removed
    [Type] BugAn existing feature does not function as intended
    on May 5, 2026
  18. Azragh commented on May 5, 2026

    @Azragh
    Author

    @t-hamano Thank you for verifying. 🙂

  19. moved this from 📥 Todo to 📋 Iteration/Tracking Issues in WordPress 7.0 Editor Taskson May 5, 2026
  20. t-hamano commented on May 5, 2026

    @t-hamano
    Contributor

    @Azragh, Regarding the pattern preview issue, it should be fixed in #77957. However, the issue in the style book cannot be reproduced yet. Do you know a reliable way to reproduce it?

  21. moved this from 📋 Iteration/Tracking Issues to ✅ Done in WordPress 7.0 Editor Taskson May 5, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

Labels

Type

No type

Projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions