-
Notifications
You must be signed in to change notification settings - Fork 648
Fix PageLayout whitespace gap on narrow viewports #7439
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
base: main
Are you sure you want to change the base?
Conversation
🦋 Changeset detectedLatest commit: 0e72d0d The changes in this PR will be included in the next version bump. This PR includes changesets to release 1 package
Not sure what this means? Click here to learn what changesets are. Click here if you're a maintainer who wants to add another changeset to this PR |
|
👋 Hi, this pull request contains changes to the source code that github/github-ui depends on. If you are GitHub staff, test these changes with github/github-ui using the integration workflow. Or, apply the |
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.
Pull request overview
This PR fixes a whitespace gap that appears in PageLayout on narrow viewports when the component has a forced height (e.g., height: 100%). The gap occurs because flex-direction: row with flex-wrap: wrap distributes extra vertical space as gaps between wrapped rows.
Key Changes:
- Added
flex-direction: columnto.PageLayoutContenton narrow viewports to prevent unwanted wrapping behavior - Added comprehensive regression test story
FixedHeightResponsivedemonstrating the fix
Reviewed changes
Copilot reviewed 3 out of 3 changed files in this pull request and generated no comments.
| File | Description |
|---|---|
packages/react/src/PageLayout/PageLayout.module.css |
Added flex-direction: column media query for narrow viewports to fix whitespace gap |
packages/react/src/PageLayout/PageLayout.responsive.stories.tsx |
Added FixedHeightResponsive regression test story with detailed documentation |
.changeset/cyan-tigers-reply.md |
Added changeset for patch release |
|
👋 Hi from github/github-ui! Your integration PR is ready: https://github.com/github/github-ui/pull/10330 |
Fixes a whitespace gap that appears on narrow viewports when
PageLayouthas a forced height (e.g.,height: 100%).Closes https://github.com/github/primer/issues/6253
Problem
When
PageLayouthas a fixed/forced height and the viewport is narrow, thePageLayoutContentcontainer becomes taller than its children need. Withflex-direction: row(default) +flex-wrap: wrap, the extra vertical space causes a visible whitespace gap above the pane.Solution
Add
flex-direction: columnto.PageLayoutContenton narrow viewports.Testing
Added a regression test story
FixedHeightResponsivethat reproduces the issue.Rollout strategy
Testing & Reviewing
Merge checklist