-
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
Global Styles: Allow themes to give all blocks a particular "Block Style" using theme.json #39063
Comments
Wouldn't this require updating every post? |
I think we'd have to change the way that block styles work, so that we have the styles stored in a data structure rather than in CSS. |
One thing I'd like to see is styles becoming presets for design controls. For instance, a "large" style for a Quote block would remove the default left border, increase the padding all around, increase the font size, and apply an italic font. This would allow us to absorb most of what exists in current In that light, styles would be less of an attribute to a block, and more like a shortcut to a bundle of properties. Couldn't a theme then just apply those same properties for particular blocks? |
Yeah that sounds good. |
@annezazu pointed me here. This sounds like it could solve something we're experiencing. Type styles are the classic example of where we want to be able to use and manage block styles more easily. We don't want our users to be able to control individual style properties like Here's an example of one of our heading styles:
If we had the option to define this styles and manage it in theme.json instead of css, that could be nice.
this would be amazing if we could control what properties are editable after the style is applied. You'll notice in the above style we're extending it to add a lighter weight version. We do this with a lot of our styles (and it's pretty common practice in design systems) where there's a main style and then some small variants that override certain properties. We've been struggling with implementing this effectively in the block editor because if we do all these as block styles it turns into a lot and many of these variants aren't used very often. I think our ideal state would be to be able to apply this main |
Closing this as contained in #7551 |
What problem does this address?
Sometimes themes want to be able to set all instances of a block to use a particular block style.
What is your proposed solution?
We should make this possible to do via theme.json so that themes can opt in to block styles for all blocks.
I imagine the syntax to look something like this:
The text was updated successfully, but these errors were encountered: