Repository navigation
Conversation
|
Size Change: +22 B (0%) Total Size: 8.19 MB 📦 View Changed
ℹ️ View Unchanged
|
Contributor
Author
|
Looks I made the mistake of testing with 'Overlay Visibility' set to 'Off'. When it's set to one of the other options, the block markup is completely different and the approach doesn't work. I think I may have to instead try duplicating the |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
What?
Fixes #62690.
Alternative to #63801 that goes a bit further.
This PR (along with the already merged #77419) should allow responsive typography to work for the navigation block.
Why?
In trunk, the navigation block's wrapper class names and styles are incorrectly duplicated on both the top level
<nav>element and the<ul>element that's a child of<nav>:When responsive styles are added, they're done so through a
wp-statesclass only on the nav wrapper:The problem is that the
wp-block-navigationclass has a style rule that sets the default font size for the navigation block:And it overrules any responsive font size applied via the
wp-states, preventing responsive font styles from working correctly. This PR should resolve the issue without breaking any nav block styles.How?
There are a few options to solve this:
A. Remove the duplicated
wp-block-navigationfrom theul(what this PR does)B. Also duplicate the
wp-statesclass to the innerul. (essentially double down on the bug)C. Make the default font size class only apply to the wrapper (update the selector to
:root :where(nav.wp-block-navigation).I chose A because B & C are essentially doubling down on buggy behavior, introducing more complexity.
The main drawback of A is that it will be more likely to cause back compat issues if a theme relies on those classnames. A dev note is definitely needed.
Testing Instructions
This will need a lot of general testing to make sure the style features in the nav block still work. I believe they do, but I may be missing something. I can see that the second bug mentioned in #68350 is still present, it causes inconsistencies for submenus between the editor and frontend, but wasn't introduced in this PR.
Screenshots
Use of AI Tools
Codex / OpenCode