-
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: output root padding CSS custom properties under the :root selector #60185
base: trunk
Are you sure you want to change the base?
Conversation
Size Change: +2 B (0%) Total Size: 1.72 MB
ℹ️ View Unchanged
|
Moving the $use_root_padding logic from compute_style_properties to get_root_layout_rules. This entails: - deleting the --wp--root--padding-* entries from PROPERTIES_METADATA - in compute_style_properties, skipping padding properties for the root block if the theme has opted into using the root padding, and removing all other padding related logic - building the rules in get_root_layout_rules.
d5ebad2
to
f81690a
Compare
} | ||
} | ||
|
||
if ( ROOT_BLOCK_SELECTOR === selector && useRootPadding ) { |
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 think I need to move padding CSS property generation back to where it was.
Consider
defaultEditorStyles.push( { |
Here getLayoutStyles
generates base layout styles - it's in edit-post
package.
Without access to global styles in the post editor, getLayoutStyles
cannot generate the root padding properties.
What?
Follow up to:
For the frontend, moving the
$use_root_padding logic
fromcompute_style_properties
toget_root_layout_rules
.This entails:
--wp--root--padding-*
entries fromPROPERTIES_METADATA
compute_style_properties
, skipping padding properties for the root block if the theme has opted into using the root padding, and removing all other padding related logicget_root_layout_rules
.Why?
How?
Testing Instructions
Testing Instructions for Keyboard
Screenshots or screencast