-
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: enqueue preset classes in the front-end #28792
Conversation
There may be blocks that don't support any style but still have the presets declared as settings. In these cases, we still need to process the settings.
Size Change: 0 B Total Size: 1.37 MB ℹ️ View Unchanged
|
I just ran into this in the latest version of the TT1 Blocks theme. Once this is fixed, if presets are defined in the "default", there is no need to define them again in "root" unless you want to override the defaults, correct? The workaround right now, is to just add them to both so the classes get enqueued. I am also running into this issue in the Site Editor WordPress/theme-experiments#201, and not sure if it is related, sorry if this is the wrong place to mention. But can't tell is the specification is incorrect in the TT1 theme, or there is a larger underlying issue like this ticket identified. |
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.
Tested and confirmed the fix. Code is good, so LGTM 👍
* Reproduce bug * Fix for all blocks selector There may be blocks that don't support any style but still have the presets declared as settings. In these cases, we still need to process the settings.
Hi @aristath, I only just noticed a small issue, in that when the global styles have been edited, the theme defined styles are rendered after the edited styles, so the edited styles do not override the theme defaults. It may be it simply needs the order switching around, I'm not too sure. Also I'm not sure whether to open a new issue or mention it here. I'm new at this so apologies in advance if this is not the correct method. |
Hi @nosolosw and @aristath again sorry if this is wrong place to mention this. Just to further elaborate, to test I used this very basic theme.json:
If we go into the Site Editor and change the accent color to In the screenshot, the |
Fixes #28780
#28533 split
global
intoroot
anddefaults
, with the goal of making it easier to share settings among the different blocks and still be able to set theroot
block independently. In doing so, it missed that, in the frontend, thedefaults
presets should also enqueue the classes for them. This adds them back.How to test
master
branch..has-black-color
,.has-dark-gray
,.has-purple-to-yellow-gradient
,.has-extra-small-font-size
,.has-small-font-size
, etc.