Repository navigation
Description
Brief
Global styles allows you to change the visual appearance of your whole website. It is also the visual interface to the singular theme.json file for a block theme. For the moment, global styles uses the sidebar API to make it live as a sidebar panel in the edit view of the site editor. Historically this has been useful to iterate the interface and make progress on the engine itself.
Fundamentally, however, the Site Editor edits individual templates or pages, making it a local interface rather than a global interface. Further, the contextual global styles sidebar panel (click a block to change the global styles for that block) is easily confused with the contextual local block inspector. You might have the global styles sidebar open, click a paragraph wanting to change the font size, and click "Typography".
A solution to that can be to move the global styles out from the edit view, and into the site view.
Proposal
In this view, the Style book can be the default view for the site editor, loaded in the frame on the right. The frame in this case, is not interactive, it's a visual preview of the styles that are chosen in the interactive panel.
This mockup relies on, and integrates design iterations to the Style book as tracked in #53431. In that issue, a curated "Overview" section of the style book is created to show the most important aspects of your website visual identity; color, typography, heading level sizes, etc.
- If you click Typography, the frame preview updates to show an exploded view of all type styles of the site.
- If you click Colors, the frame preview updates to show just a map of the color swatches.
- If you drill into the block section, each individual block, perhaps even patterns that leverage this block, can be shown. This will, for example, be useful should we move in the direction of showing pseudo states as well, in this exploded view (see Standardized way to modify interactive states (:hover, :focus .etc) for blocks #38277 (comment))
For the moment, the visual mockup above assumes a 1:1 transplant of the existing global styles sidebar into site view. See more explorations in Figma, here and here. One of those explorations can be seen here, and can be part of a future evolution of this work:
styles.mp4
Related: #53483.
Metadata
Metadata
Assignees
Labels
Type
Projects
- StatusShow more project fieldsDone

Activity
richtabor commentedon Oct 23, 2024
I'm not particularly confident in having style book as the default for this view. I would think that you'd want to see the effect of style changes on your site, rather than abstracted in style book.
ramonjd commentedon Oct 24, 2024
tellthemachines commentedon Oct 24, 2024
I'm all for moving global styles to a place where it's easier to access! I do think we have to be careful with screen real estate and the double sidebar. Looking at the figma links, this one looks like it might make best use of space:
Alternatively, it could also work to have the whole global styles menu in the black sidebar and open up "browse styles" by default in the second sidebar (my shitty mockup below, sorry)
Whichever way we go with this, we need to consider where the stylebook is going to live in the future.
Or
I think we need to decide which way to go soon, otherwise we risk doing a ton of work on the stylebook that will later have to be changed or undone if we decide to move it somewhere else.
youknowriad commentedon Oct 24, 2024
I think we need to acknowledge that the current mix of global styles and templates or global styles and document editing is bring unclarity to regular users.
I understand the arguments about Changing global styles and wanting to see the changes in a given template/post...
But for me, we've over optimized for this causing more confusion for regular users wanting to just change some obvious global styles (colors, backgrounds...), the common case over advanced users that know what they're doing when they open the global styles sidebar.
For regular users, they mostly get confused about What is this sidebar in the editor even about, is it about the current selected block, the current selected document or global (unless you know your way around WordPress, and FSE, for most it's very hard to understand that it's global) and no snackbar, guide or whatever is going to change that, these are complementary and not the real solution to the problem. It is also really easy to be overwhelmed when you go into the editor when you only want to make some global styles changes.
So, yeah, for me the only solution is to actually pull away the sidebar from the editor into its own global "styles" section. This doesn't come without challenges, but I think the confusion above is more important to solve than the challenges that come with moving this to a global place:
Challenges:
All these become possible if we start thinking about this section as an "editor focused on global styles" which free us from thinking about templates, pages... and I believe clarify things for the users and simplifies the mental model.
Another challenge raised above is about the sidebar design. I think that's an ok tradeoff to embrace for now, I agree it's not ideal, but the same issue exists for "list views" for pages and we didn't see too much dramatic feedback about it. It deserves a unified solution rather than one that is specific to styles.
tellthemachines commentedon Oct 24, 2024
How hard a problem would that be to solve though? I reckon it's worthwhile considering, especially now that this pattern of black sidebar + white sidebar seems to be spreading throughout the UI 😄
youknowriad commentedon Oct 24, 2024
I can't tell for sure, I know that we did experiment with the global styles in the "black area" with @jorgefilipecosta a long time ago, it was doable with some CSS hacks. It might be better today. So we won't know unless we try it (if designers think this is a good approach)
jameskoster commentedon Oct 24, 2024
Themeable components is an important part of the admin redesign and design systems work. It will enable user personalisation through light/dark modes, contrast preferences, and so on. It's not a trivial task though cc @ciampo @mirka @tyxla.
At its core, the dark sidebar is primarily for navigating through the admin, so elements of the Styles UX—such as switching between variations, colors, typography, and blocks—could theoretically be placed there (needs design exploration). However, I believe that forms should remain within the Content Frame (the middle sidebar). It's important to note that the Content Frame is the same container in which Data Views live. Ideally, we should align with these emerging conventions to maintain consistency and avoid ad hoc solutions that water down the overall UX. I appreciate that documenting layout would be helpful, it would be good to do this as a part of the design systems work.
Initially it seems simplest to place the entire Styles panel inside the content frame, like the mockups in the OP. Moving the navigational pieces to the sidebar could happen (as mentioned above), but needs some design exploration.
In terms of switching between site / style book, there is a mockup here:
jasmussen commentedon Oct 24, 2024
We can potentially make the style vs. templates even more visible a switch, by making it a segmented control (if we can find good labels). But even then we have to acknowledge that in this site-view first version of styles, there's currently no interface for choosing which template you can see. It's just the homepage. Which has value of course, and is arguably sufficiently representative of "the site" to be useful. But I agree with the arguments presented, for why Style book is ultimately a better default, including these:
An added value of global styles in site view is that this can much more easily make the site editor with global styles available to classic themes, or even hybrid themes, because a style book can be useful for any one of those configurations.
An additional benefit is that if we were to move towards the style book being the primary place where you can see and style every state of a block (current menu item, hover, active, focus), it may increase the prominence and discoverability:
The style book is a coffee-table book, a visual identity of your website. It shows every block, heading, color, and setup that you have available, even when those blocks are not used in your site yet.
mtias commentedon Oct 24, 2024
@jameskoster also curious if instead of a dropdown with two options it could just be a segmented control with two options.
[-]Styles panel: Show global styles, and style book by default, in site view[/-][+]Dedicated Styles Screen[/+]13 remaining items
jameskoster commentedon Oct 29, 2024
Excellent question, one we should answer before redesigning the panels for sure. I see a lot of feedback that the Styles panel in the editor creates a lot of confusion, I sometimes get caught out by it myself! That said it should still be possible to reach global styles from the editor somehow.
Agreed, though this is a global consideration. Saxon shared some ideas here.
I'm not against labels for each section at all.
jameskoster commentedon Oct 29, 2024
Agreed. Landing the PR associated with this issue feels like a good first step. I think it's just missing the Style Book toggle.
ramonjd commentedon Oct 29, 2024
iI wasn't obvious to me at first, but I think I found it. Maybe I was expecting a different icon. 🤔
2024-10-30.08.05.09.mp4
annezazu commentedon Oct 29, 2024
This isn't obvious enough IMO. I could not find it until seeing this video :)
ramonjd commentedon Oct 29, 2024
I'm thinking it could be moved to the header (if that's possible). We're still relying on the icon telling the story, it might be more accessible and faster to grok with a text button. 🤷🏻 I'll play around.
tellthemachines commentedon Oct 29, 2024
It'll definitely be more accessible. Those icons all look the same to me 😅
afercia commentedon Oct 30, 2024
Please use a text button.
Icon buttons have inherent accessibility and usability problems. To be more clear: the proliferation of icon buttons is problematic.
As reported several times in many other issues and PRs: icon buttons may add value in certain cases when they are limited to a set or well recognizable icons. However, wherever the UI provides enough space to show visible text, text buttons should be preferred.
I'm not opposed to buttons that show an icon and visible text, as that would use the best from both worlds.
I find particularly confusing icon buttons that 'switch' icon depending on the state. This has been reported as problematic several times as well. Buttons should not be used to communicate the state or the selected value. Instead, buttons must clearly communicate the underlying action. I do see this pattern is used in other places in the UI but I'd warn against it and strongly recommend to reconsider it.
richtabor commentedon Oct 31, 2024
Same. I'm not a proponent of this one button toggle icon to switch between the two views. Do we have this pattern elsewhere?
ramonjd commentedon Oct 31, 2024
It's going through iterations. I'll aim to implement @jameskoster's tip on the Menu component.
jasmussen commentedon Nov 1, 2024
#65619 is close to landing. I shared a slightly updated mockup there, will copy it here as well:
Same button, compact, lines up vertically with items in the list, same style as is used in similar contexts (including the document inspector, etc). Click to toggle between style book and templates.
It's worth remembering what the goal is here:
Details are important. But it's also easy to get caught up in looking far ahead, through style updates, the appearance of menu items, separators or not. All of those are valid and worth getting to, but it's useful to focus on the specific improvements at hand first, get this into the plugin so that it can be tested, and to help inform those future iterations so we move with intent.
To that end, I would suggest putting the few final tweaks on #65619, and then moving all attention to improving the style book (#66517). After that, we can make progress on bringing these improvements to classic themes (#41119, #64409), which is oft-requested and can be a big win, and after that, allowing the styling of pseudo states (#38277 (comment)). This will significantly help block themes, that users are able to finally provide clear and contrastful focus styles, in the visual editor where we can show contrast warnings as aids. Default browser focus styles are not always sufficient.
This will also not preclude future enhancements, as noted initially in this issue, which refer to space efficiency, merging columns, and providing theme packages to enable the styling controls in additional color contexts. As noted on details, we'll get to this, but perhaps best to focus on the more meaningful steps forward that we can take first.
tellthemachines commentedon Nov 6, 2024
Should this issue have been closed by #65619 or are we still planning to improve the double sidebar experience by moving the global styles navigation into the black sidebar?
With #65619 merged and with #66719 upcoming, the designs in #66517, which explicitly deal with a tabbed interface, are less applicable.
I've started work on a landing section for the style book in #66545, so playing with that should be a good starting point for working out what this landing will look like with the style book in its new location. I'd appreciate feedback, ideas, designs on this!
andrewserong commentedon Nov 6, 2024
We've implemented the first stage, and there's quite a lot of discussion here, so closing seems appropriate to me. We could open up a follow up issue to tackle the next stage(s) of working on moving some things to the black sidebar and progressing the designs further?