Repository navigation
Stop nav overflow growing in column flex parents - #43270
Open
1AbdullahButt wants to merge 1 commit into
Open
1AbdullahButt wants to merge 1 commit into
1AbdullahButt wants to merge 1 commit into
Conversation
The wrapper needs `flex-grow` to get a width in a row, but in a column the same grow takes a share of the free height. This pushes the next sibling away from the nav. CSS can't read the parent's direction, so remove the grow only under the known column parents, and document `.flex-grow-0` for the others. Rows don't change. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
This branch has not been deployed
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.
Description
flex-growfrom.nav-overflowwhen its parent is a.card,.dialog,.drawer, or.flex-column..md:flex-rowor.flex-row. In a row, a wrapper that doesn't grow is 0px wide, and every item moves to "More"..flex-grow-0, or.flex-grow-0 .md:flex-grow-1for a parent that changes direction.Motivation & Context
flex: 1 1 0gives the wrapper its width in a row. In a column, it takes a share of the free height..nav-overflowworks for both. This rule names the known column parents..navbar. I didn't use it, because each plain.d-flexrow would collapse to 0px until the author adds.flex-fill. This change has no effect on rows..cardand.dialogaren't in the issue. I added them because they show the same bug with a fixed height..md:flex-column,.flex-column-reverse, and.lg:drawerbelow its breakpoint. A.flex-columnwith a row class also still has the bug while it is a column.[class*="-row"]also matches unrelated classes, such as.my-row. In that case the bug stays, but the nav doesn't collapse.Height of the wrapper with a 38px nav, measured in Chromium at 1920×1080 with the compiled CSS and the JS bundle:
.drawer.flex-column.min-vh-100.card, 600px high.dialog, 600px high.flex-grow-1on the wrapper still overrides the rule..d-flex,.d-flex.flex-wrap,.navbar,.flex-column.md:flex-rowat 1920px, and.card.flex-row. A block parent also doesn't change..drawer.npm run lintexits 0 with 6 warnings and no errors.npm run css-test,npm run css, andnpm run docs-buildpass..flex-grow-0already works in Firefox, and this rule sets the same property.scss/tests.Type of changes
Checklist
npm run lint)Live previews
Related issues
Fixes #43162
🤖 Generated with Claude Code