-
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
Navigation: Remove unneeded gap:inherit rule on wrapper element of navigation block #43669
Conversation
…p is provided by layout support
Size Change: -14 B (0%) Total Size: 1.24 MB
ℹ️ View Unchanged
|
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.
Thanks for working on this, let's try it. As it turns out, the PR is the same as I tried in #43422, which eventually I closed as it seemed like a Global Styles preset as suggested in the comments there might be a better approach. That might still be the case, but per your debugging around specificity changes, this seems like the approach.
Before, empty theme and TT17, editor and frontend:
After, TT17 and empty theme, editor and frontend:
I'd love a sanity check from another! But otherwise land it, thank you for the PR!
Thanks for reviewing @jasmussen! Apologies, I was working too quickly and didn't take a look at your previous effort there. I think this fix is probably a good short-term approach so that we're mostly focusing on resolving the current bug — flex layouts get a default value of Semi-related, the Columns block has a default / fallback value of
Good thinking. I wonder if @scruffian or others might be able to give us a confidence check here? |
Oh no need to be sorry, I appreciate you taking the energy to shepard this one all the way through! 🙏 |
I'm feeling pretty confident about the approach here and am back from travelling, so will merge this one in. Happy to follow-up if it winds up causing any issues. |
What?
Fixes #42955
Remove the
gap: inherit
rule for the root Navigation block classname selector.Why?
The Layout block support provides default gap rules for blocks that opt-in to Layout support. For classic themes, in order to ensure that the Layout support does not erroneously override theme styles, the specificity of the default / fallback gap styles are intentionally lower (as introduced in #42665).
However, it appears that the Navigation block currently sets
gap: inherit
which overrides this rule. As far as I can tell, thewp-block-navigation
rule here is a hold-over from back when the block needed to provide its own explicit styles. The inherit rule should only apply to children (or child elements) of the navigation block, and not the root / wrapper element.How?
.wp-block-navigation
from the list of classnames where the Navigation block applies thegap: inherit
ruleTesting Instructions
gap: inherit
ruleScreenshots or screencast