-
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
WIP Give themes control of visual styles for core blocks #6721
Conversation
Questions for review:
|
5553e15
to
3881478
Compare
docs/extensibility/theme-support.md
Outdated
|
||
## Styling blocks | ||
|
||
### Default theme styles |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
"Default block styles"
docs/extensibility/theme-support.md
Outdated
|
||
### Adding block styles | ||
|
||
Themes may add styles for individual block types. You can do this by adding a `blocks` folder and filling it will files named after the blocks you want to style. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
type "will"
lib/client-assets.php
Outdated
/** | ||
* Enqueues block styles provided by the theme. | ||
* | ||
* @since 2.9.0 |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
todo, fix version number
Thanks for your review, @mtias. I pushed fixes to address your comments. |
Related to #6651
Also see the notes about how we should be doing class names and class injection to properly support extensibility. |
Closing this in favor of a simpler PR for block style separation (#6947) and likely another in support of theme overrides for specific block types. |
Description
This is a PR to:
Contributes to #5360.
How has this been tested?
This has been tested manually with a parent theme. It needs to be tested with a child theme where both parent and child specify styles for the same block types. It would also be good to add unit tests.
Types of changes
theme.css
for each core block.build/theme.css
file.build/theme.css
when themes enable support forwp_block_styles
.blocks/
directory and a CSS file per block styled by the theme. Example:<theme-dir>/blocks/core.quote.css
.Checklist: