-
Notifications
You must be signed in to change notification settings - Fork 4.3k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Feedback on adoption approach for exposing editable UI for the Style Book for Classic themes #68036
Comments
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 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. |
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:
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! |
Ah yes! Let me update to make that far clearer. Thank you. |
I think the important thing here is that Considering that, relying on the existence of Personally, I prefer the following approach:
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
}
}
} |
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:
The motivation for relying on the existance of theme.json comes down to a few aspects:
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. |
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. By not having it opt-in there is a big potential to introduce a broken feature and a confusing feature on many live websites.
|
Correct, theme.json is not a required file for block themes. |
We could also make it opt-in using extra arguments for Example: add_theme_support( 'editor-styles', array(
'style-book' => true,
) ); |
What happens if the parent classic theme does not have templates/index.html and style.css files but a child theme does? |
After re-reading the discussion in #67782,
But not when the classic theme only has the editor style theme support, because of how long this has been available and because in my opinion, it is unlreated. All classic themes should be able to opt-out, even if it has a theme.json. For example if the theme developer has already added their own style guide. But the theme support as well as the check for it needs to be added in way that allows the theme developer to extend the functionality once it is implemented. I mean as discussed above, if the theme.json file includes typography settings, the typography should be available. Because we don't want to have to change the formatting of the theme support later because all planned features were not implemented yet. |
I haven't checked in a while, but we already enabled some theme support flags based on It would be nice to avoid some implicit logic based on what A classic theme with a The A classic theme without a The |
I agree with the approach of being explicitly enabled or disabled via theme support. By the way, I remember seeing an issue somewhere considering exposing the global styles to the classic theme. Taking this into consideration, I think one of the following approaches might be the best: add_theme_support( 'editor-styles', array(
'style-book' => true,
'gloabl-styles' => true,
) ); add_theme_support( 'site-editor', array(
'style-book' => true,
'gloabl-styles' => true,
) ); |
yeah using "site-editor" to plan for future changes sounds like a good idea |
Using the |
With the additional parameters, the fact that editor-styles has been used for many years is not a hindrance anymore 👍 . But they are not editor styles. The default block styles and the global styles are applied to blocks both in the editor and front. |
Current: Also: |
I don't have a strong opinion, but the reason I want to avoid If we want to be more abstract, how about |
Don't have a strong opinion on the name as long as it conveys the meaning. Having a single new support key + flag options seems more future-proof. I wish I'd thought about that while working on template part support.
@t-hamano, this came up recently in a different bug report - #68887. |
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:
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.
The text was updated successfully, but these errors were encountered: