Skip to content

Feedback on adoption approach for exposing editable UI for the Style Book for Classic themes #68036

Open

Description

@annezazu

Context:

As of Gutenberg 19.9, the Style Book is now exposed to Classic themes. As it stands, support is available for Classic themes that either support editor styles via add_theme_support( 'editor-styles' ) or have a theme.json file. Without either, the Style Book doesn't display anything useful. Here's a quick demo using Twenty Twenty-One:

tt1.style.book.mov

In particular, the current thinking is that by having a theme.json file in a Classic theme that this marks an explicit opt in and, to quote @jasmussen, "edibility is progressive, insofar as if your theme.json is empty, or virtually empty, little to nothing would be editable. But for each array you add, whether that array is empty or not, would unlock part of the interface." For example, if you add settings.typography options, this would then give a user access to the UI for Typography and, potentially in the future, the font library.

With all of this in mind, another PR is open to enable the Style Book regardless of whether a classic theme has theme.json or supports editor styles! All of this begs the question and points to needing to get right the opt in and opt out approach to provide the most value when it comes to exposing editable UI to users of classic themes. This issue seeks to gather that feedback to ensure we can come to the best decision possible.

Feedback needed

From what I can see we have two main tension points:

  • Do we rely on the presence of editor styles or theme.json to opt in OR expose to all and provide a way to opt out?
  • Is there value in showing a non editable Style Book and is that an experience users will understand? In the comments on this issue, the desire for this is clear but I am noting this for comprehensiveness as there's a concern that this could be confusing for users in situations where nothing is editable.
  • Does the presence of a theme.json with settings automatically opt a theme into exposing parts of the global styles UI related to those settings or is an explicit opt in necessary to expose any of the global styles UI, in addition to a theme.json?

Please share feedback on the current approach and the desired approach you'd like to see. cc @WordPress/outreach & @WordPress/block-themers for good measure.

Activity

  1. added
    [Feature] Themes
    [Status] In discussion
    [Type] Feedback
    Global Styles
    on Dec 16, 2024
  2. ironprogrammer commented on Dec 17, 2024

    @ironprogrammer
    Member

    Speaking from experience, in my agency days doing (now "classic") custom themes I typically created a private page as a style guide, which was quite similar to the Style Book. It wasn't intended for editing, but for visual reference and to ensure we had all the major elements covered. There may or may not have been liberal use of Save+Refresh while dialing in the stylesheet 🫣.

    I like the idea of having this as a utility for any classic theme. It shows off some coolness that block themes get, but also reveals what elements/blocks you might have missed in your styles. It could be a subtle hint to upgrade to theme.json or a block-based theme to get all the benefits.

    For those used to working with classic themes, I don't think there's much of an expectation of being able to live-edit with a design "preview" feature like this.

  3. tellthemachines commented on Dec 17, 2024

    @tellthemachines
    Contributor

    the current thinking is that by having a theme.json file in a Classic theme that this marks an explicit opt in and, #66851 (comment) @jasmussen, "edibility is progressive, insofar as if your theme.json is empty, or virtually empty, little to nothing would be editable. But for each array you add, whether that array is empty or not, would unlock part of the interface." For example, if you add settings.typography options, this would then give a user access to the UI for Typography

    I think it needs to be very clear that, in its current iteration, the style book doesn't include any editing UI.

    What is being discussed for future iterations is how to expose parts of the global styles UI for hybrid themes that have a theme.json. There are a couple possibilities:

    • The presence of a theme.json with settings should automatically expose parts of the global styles UI related to those settings.
    • An explicit opt in should be necessary to expose any of the global styles UI, in addition to a theme.json.

    Based on the feedback in #41119, I'm more inclined towards the second option, as theme authors may want to leverage theme.json for styling purposes without necessarily exposing edit functionality. Having controlled editability is one of the reasons for creating a hybrid theme instead of a block theme in the first place.

    I'm very curious to hear what other folks have to say on the topic!

  4. annezazu commented on Dec 17, 2024

    @annezazu
    ContributorAuthor

    Ah yes! Let me update to make that far clearer. Thank you.

  5. changed the title [-]Feedback on adoption approach for exposing the Style Book for Classic themes[/-] [+]Feedback on adoption approach for exposing editable UI for the Style Book for Classic themes[/+] on Dec 17, 2024
  6. t-hamano commented on Dec 25, 2024

    @t-hamano
    Contributor

    I think the important thing here is that theme.json is not taken into account to determine if the current theme is a block theme, i.e. if the global styles UI is available. If only the templates/index.html and style.css files exist, the theme is treated as a block theme and can access the site editor and global styles.

    Considering that, relying on the existence of theme.json is at least a little confusing to me. Also, classic theme developers may develop themes based on theme.json but not want the global style UI to be available. In fact, I also develop many classic themes with theme.json for clients as a freelancer, but the purpose is to define block styles without adding CSS styles, and I do not want the global style UI to be automatically exposed.

    Personally, I prefer the following approach:

    • Expose Style Book for all classic themes. Explain with more detailed text that the Style Book cannot be edited.
    • Add theme support for classic themes to be able to use the global style UI. For example, something like add_theme_support( 'global-sryles-ui' ).

    Or, to show/hide some UI, we might be able to consider the following approach in theme.json:

    {
    	"version": 3,
    	"settings": {
    		"typography": {
    			"showGlobalStylesUI": false
    		},
    		"color": {
    			"showGlobalStylesUI": true
    		}
    	}
    }
  7. jasmussen commented on Dec 25, 2024

    @jasmussen
    Contributor

    I've prefixed most of my feedback on this issue that I do not feel strongly about this, and think that folks who feel more strongly about this, should decide. So I'm happy to support either direction. I did want to respond to this:

    Considering that, relying on the existence of theme.json is at least a little confusing to me.

    The motivation for relying on the existance of theme.json comes down to a few aspects:

    1. Followup updates to the Style Book are meant to progressively unlock features for classic themes. Add a palette array, and you get edit access to color palettes. Add a font sizes array and you get access to editing typography, and get access to the font library. Etc.
    2. Having the initial opt-in be about the presence of the theme.json file leans into the fact that this is the same file that you will need to edit, to make the style book editable.
    3. It avoids another theme support property to keep track on.
    4. It has this opt-in, as opposed to an opt-out, because I still think having Style Book as an interace that vaguely resembles the customizer, but isn't editable at all, is going to be more confusing than not having it.

    Ultimately, I do feel strongly about letting users opt into editable aspects of the style book. But whether the style book itself is opted into our out of, I'll defer despite the stated not-so-strong opinion.

  8. carolinan commented on Jan 2, 2025

    @carolinan
    Contributor

    In my opinion, the correct way would be for the new feature to be opt-in, because the majority of older classic themes have not been tested with block styles.
    It should be explicitly enabled with add_theme_support.

    By not having it opt-in there is a big potential to introduce a broken feature and a confusing feature on many live websites.
    Please remember that editor style for classic themes was introduced in WordPress 3.0. I think that makes it inappropriate to use for progressively unlocking new features.

    (By the way, testing the feature today, with Gutenberg trunk it does not even work, there is no preview and there is a JS error on the color palette.) This has since been resolved

  9. carolinan commented on Jan 2, 2025

    @carolinan
    Contributor

    I think the important thing here is that theme.json is not taken into account to determine if the current theme is a block theme, i.e. if the global styles UI is available. If only the templates/index.html and style.css files exist, the theme is treated as a block theme and can access the site editor and global styles.

    Correct, theme.json is not a required file for block themes.

  10. Mamaduka commented on Jan 16, 2025

    @Mamaduka
    Member

    We could also make it opt-in using extra arguments for editor-styles.

    Example:

    add_theme_support( 'editor-styles', array(
        'style-book' => true,
    ) );
  11. BowFarmer commented on Jan 16, 2025

    @BowFarmer

    What happens if the parent classic theme does not have templates/index.html and style.css files but a child theme does?

  12. 52 remaining items

  13. apmeyer commented on Mar 26, 2025

    @apmeyer

    As a developer of hybrid (classic) themes I'd like to be able to opt out of having Style Book available.

    I work with agencies to develop very tailored custom themes. We use (and love) the block editor. The themes/designs use native blocks with custom styles (as much as possible), typically with a mix of custom blocks when necessary. There is never a project that has custom styling for every single native block, since most are not relevant to a given project. So, the Style Book ends up showing a whole slew of components that are not applicable to a project and have no project-specific styling. This leaves like 75% (or more) of the Style Book inapplicable and undesirable.

    We rely on Block Patterns (both sync'd and not), which is super handy. But now there's an extra step to get to screen to find/manage those patterns (with the latest Gutenberg plugin active in a dev environment). Previously there was a "Patterns" menu item under Appearance. Now it's Appearance > Design > Patterns. And along that path there's a link to the mostly irrelevant (in these cases) Style Book screen.

  14. apmeyer commented on Mar 26, 2025

    @apmeyer

    For hybrid (classic) themes, I could see the Style Book being more handy if it only displayed blocks that were included/customized via theme.json (styles.blocks) – and all other blocks excluded.

    If a way to opt out is not included, I suspect I'll end up just manually removing the "Design" submenu page and adding a custom submenu page for edit.php?post_type=wp_block. I can work around the limitation.

    The Design pages would still be accessible should someone know the URLs to get to them, but that would not be huge concern for my scenarios (I could see it being a concern for some people, though).

  15. MadtownLems commented on May 30, 2025

    @MadtownLems

    We are using a hybrid theme with theme.json - am I correct to understand there's currently no supported method of opting out of the StyleBook?

    It doesn't really help our users, and is just clutter (when we try to keep the administrative experience free of clutter whenever possible).

  16. t-hamano commented on May 31, 2025

    @t-hamano
    Contributor

    am I correct to understand there's currently no supported method of opting out of the StyleBook?

    Yes. In the current specification, the StyleBook will be exposed if the active classic theme meets any of the following conditions:

    • The active theme has the editor-styles theme support
    • The active theme has a theme.json file
  17. MadtownLems commented on Jun 2, 2025

    @MadtownLems

    Yes. In the current specification, the StyleBook will be exposed if the active classic theme meets any of the following conditions...

    Does the presence of a theme.json with settings automatically opt a theme into exposing parts of the global styles UI related to those settings or is an explicit opt in necessary to expose any of the global styles UI, in addition to a theme.json?

    Well, then in the interest of providing feedback on the adoption approach, consider this my formal request that this stylebook be easy to disable. :) (Generally speaking, I think that's one of the major areas that Gutenberg has been lacking. Before Gutenberg, so many features were easily controllable via filters or settings. There are countless features of Gutenberg that I've wanted to disable in its already relatively short life that seemingly provide no method of doing so.)

  18. t-hamano commented on Aug 22, 2025

    @t-hamano
    Contributor

    This issue has been punted to 6.9. Let's move this issue to the 6.9 Editor Tasks board and see what's possible in 6.9.

  19. t-hamano commented on Sep 8, 2025

    @t-hamano
    Contributor

    If I understand correctly, the only thing to discuss here is:

    I think the only question left to resolve is whether an independent opt-out for this feature should be implemented.

    As I understand it, the stylebook for the classic theme is merely an intermediate step, and the ultimate goal is to make the global styles available to the classic theme as well. Therefore, in the future, there will probably also be requests such as "I want to hide the global styles UI in the classic theme."

    With that in mind, I think that one of the more comprehensive approaches might be to implement a way for the classic theme to opt out of the entire global styles UI, including stylebook.

    add_theme_support( 'global-styles-ui' );
    
    // or...
    
    add_theme_support( 'editor-styles', array(
    	'gloabl-styles-ui' => true,
    ) );
  20. tellthemachines commented on Sep 8, 2025

    @tellthemachines
    Contributor

    As I understand it, the stylebook for the classic theme is merely an intermediate step, and the ultimate goal is to make the global styles available to the classic theme as well.

    Global styles should only be available to classic themes that have a theme.json file (so I guess they're more under the definition of "hybrid" themes)

    This is not to say there shouldn't be an opt-out for all classic themes! But with regards to editability it should only be possible given the existence of a theme.json, and for the properties defined in it.

  21. t-hamano commented on Oct 22, 2025

    @t-hamano
    Contributor

    Since 6.9 Beta1 has been released, let's punt this issue to 7.0.

    As I understand it, the stylebook for the classic theme is merely an intermediate step, and the ultimate goal is to make the global styles available to the classic theme as well. Therefore, in the future, there will probably also be requests such as "I want to hide the global styles UI in the classic theme."

    With that in mind, I think that one of the more comprehensive approaches might be to implement a way for the classic theme to opt out of the entire global styles UI, including stylebook.

    Note that there is an ongoing effort to bring the Global Styles to the post editor: #72317

  22. moved this from ❓ Triage to 🦵 Punted to 7.0 in WordPress 6.9 Editor Taskson Oct 22, 2025
  23. removed their assignment
    on Feb 27, 2026
  24. t-hamano commented on Sep 25, 2026

    @t-hamano
    Contributor

    With #73971, the user global styles data (wp_global_styles) is now saved even in classic themes. Because of this, it might be worth revisiting the idea of exposing Global Styles to classic themes.

    If so, there are probably a few key decisions to make:

    1. Should Global Styles be enabled by default?
    2. If enabled by default, under what conditions? For example, StyleBook is automatically exposed to classic themes that either have a theme.json file or support editor-styles.
    3. What should the theme support key be?
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    Global StylesNeeds DecisionNeeds Design Feedback[Feature] Style Book[Feature] Themes[Status] In discussion[Type] Feedback

    Type

    No type

    Projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions