-
Notifications
You must be signed in to change notification settings - Fork 4.2k
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
Allow themes to use any styles in the theme.json whether or not the block supports it #29941
Allow themes to use any styles in the theme.json whether or not the block supports it #29941
Conversation
Size Change: +1.56 kB (0%) Total Size: 1.4 MB
ℹ️ View Unchanged
|
It works and it's brilliant and I'm walking on sunshine. |
@nosolosw, can you provide a more detailed description of what has changed with this PR? I'm having a hard time understanding how it impacts a single block. In particular, I'd be interested in seeing how it impacts |
@gziolo expanded a bit on the "changes in this PR" section, does that help? In terms of block.json, nothing changes. In terms of theme.json, the noticeable change is what I shared in the test instructions: that themes can know use style properties in the theme.json in blocks that don't declare support for them (ex: use a font-family for paragraphs despite the block doesn't declare support for font families). |
Thanks, @nosolosw. I think I get it now 😄 Code changes look good, I would appreciate some validation from other folks that know better how it works in practice. |
I think this is not only the right direction but also simplifies the codebase quite a bit |
@mtias, and the efforts required to keep the documentation up to date, instead we have this really nice sentence:
|
Co-authored-by: Greg Ziółkowski <grzegorz@gziolo.pl>
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.
I love it, a lot simpler than what we had before and makes perfect sense to go in this direction. 👍
Implements #29778 (comment)
With this PR, block supports are no longer used to decide whether the styles in the theme.json for a block should be used or not. Block supports are still used to show UI controls in both the block & global styles sidebar (themes can use any style property, users can use use the style properties "supported" by the block).
Changes in this PR:
Server:
Client:
Update theme.json docs accordingly.
How to test
Make sure existing themes work as expected: using TT1-blocks go to the site editor and load the front-end. Verify they work as expected.
Make sure themes can use any style property in the theme.json file:
Before this change, the font-family for the paragraph will be ignored.