-
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
Global Styles: Add block spacing to root block support UI #42797
Global Styles: Add block spacing to root block support UI #42797
Conversation
Size Change: +286 B (0%) Total Size: 1.26 MB
ℹ️ View Unchanged
|
This tested well for me. The only thing I noticed is that blockgap.mp4Not sure where the 24px comes from 🤔 Block gap in the theme.json is set to 1.5rem. |
Thanks for testing @glendaviesnz!
Which theme did you have active? I'm assuming it was TwentyTwentyTwo if the theme.json has the value set to I'll do some more testing. |
It was TT1 blocks with the following added to theme.json settings:
|
@glendaviesnz is that in The blockGap value should be in |
🤦 Doh - works as expected when put in the right place, ie. 'Reset all' returns the Block gap value in global styles to the value in theme.json |
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.
This worked as advertised for me.
✅ Changes to block gap in global styles reflected in site editor canvas
✅ Changes saved to block gap in global styles reflected in site front end
✅ Resetting block gap in global styles resets to default value from theme.json
✅ Setting block gap at block level in global styles or page editor continues to work as expected
Thanks for the reviews @glendaviesnz, much appreciated! |
What?
Add
blockGap
/ block spacing to the root Layout global styles panel.Why?
Now that the Layout refactor in #40875 has resolved the hierarchy of blockGap style output, we should be able to safely add back in the UI for the root level control.
How?
blockGap
to the list ofROOT_BLOCK_SUPPORTS
hasGapValue
andhasPaddingValue
checks so that they check against whether or not a user value has been provided. This resolves an issue at the root level for both style value types where the ToolsPanel dropdown menu would still display the item as though it had a value even after it has been reset.Testing Instructions
settings.spacing.blockGap
is set to eithernull
orfalse
Screenshots or screencast