-
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
Layout: Try removing body element from base layout rules #42518
Layout: Try removing body element from base layout rules #42518
Conversation
In testing, I actually think we probably need the For example, in this branch, the Column block's bottom margin takes precedence, where we actually want the base layout's gap rule to take effect:
@tellthemachines just pinging you since you'd brought up exploring removing the Let me know if you think it's still worth pursuing, otherwise I think I might close out this exploration for now. |
Size Change: -1 B (0%) Total Size: 1.26 MB
ℹ️ View Unchanged
|
Thanks for trying this out!
Yeah, looks like we might have to do so. Would that margin on the Columns block be necessary for block themes, or only for classic themes I wonder? Perhaps at some point we could work out what styles we no longer need for block themes and serve them only if a classic theme is detected? In any case, yes, I think we can shelve this for now as it doesn't look like it's immediately doable! |
Thanks for taking a look!
Yes, I think there's more intuitive work we can do surrounding this. In my mind, ideally, if we're using layout spacing everywhere in blocks-based themes, individual blocks shouldn't be providing their own margins. It'd be good to come back to that kind of idea once layouts have progressed a bit further. I'll close this one out. Thanks again! |
What?
🚧 🚧 🚧 🚧 WIP: This is an exploration at the moment 🚧 🚧 🚧 🚧
Part of #39336 and following on from a suggestion in https://github.com/WordPress/gutenberg/pull/40875/files#discussion_r914497178.
This PR removes
body
from the base layout rules such as.is-layout-flow
and.is-layout-flex
.Why?
The premise is that we only need to prefix the Layout rules with the selector when the selector is for a particular block, the base layout rules only need to be attached to the Layout type's classname — specifying the Layout rules as being a descendant of
body
is unnecessary.How?
Update the Layout rules to remove the selector from the rule construction when the selector is the root block selector.
Testing Instructions
Screenshots or screencast