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
PageLayout: Prevent content region from wrapping on wide viewports #1846
Conversation
🦋 Changeset detectedLatest commit: bbdfc2d 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 |
size-limit report 📦
|
🚫 Looks like this broke the other stories. Investigating... |
Fixed with |
src/PageLayout/PageLayout.tsx
Outdated
// Set flex-basis to 0% to allow flex-grow to control the width of the content region. | ||
// Without this, the content region could wrap onto a different line | ||
// than the pane region on wide viewports if its contents are too wide. | ||
flexBasis: '0%', |
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.
Minor nitpick: we could just say flexBasis: 0
. We don't need the unit
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.
good catch!
Problem
If the contents of
PageLayout.Content
are too wide,PageLayout.Content
wraps onto a different line thanPageLayout.Pane
.Solution
This PR fixes this issue with a combination of
flex-grow: 1
andflex-basis: 0%
to ensure thatPageLayout.Content
never wraps on wide viewports.Screenshots
Browsers
Part of https://github.com/github/primer/issues/565