Skip to content

Commit 5260057

Browse files
Fix content blowout (#739)
* Fix width blowout with wide content In React Brand there are a few pages where the content on large screens is wider than other pages. At certain breakpoints it also overlaps the navigation. This is a quirk of a flex child not collapsing where its children have wider content than the flex calculation. The default min-width is auto, and since there are children with width: 100%, auto corresponds to max-content, which causes the blowout. To fix this we can set the min-width to 0, which will make the children respect the flex calculation. See https://css-tricks.com/flexbox-truncated-text/#aa-the-solution-is-min-width-0-on-the-flex-child * Add changeset
1 parent b17fcc8 commit 5260057

File tree

2 files changed

+6
-1
lines changed

2 files changed

+6
-1
lines changed

.changeset/polite-rivers-lay.md

+5
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,5 @@
1+
---
2+
'@primer/gatsby-theme-doctocat': patch
3+
---
4+
5+
Fix content blowout

theme/src/components/layout.js

+1-1
Original file line numberDiff line numberDiff line change
@@ -108,7 +108,7 @@ function Layout({children, pageContext, path}) {
108108
<TableOfContents aria-labelledby="toc-heading" items={pageContext.tableOfContents.items} />
109109
</Box>
110110
) : null}
111-
<Box sx={{width: '100%', maxWidth: '960px'}}>
111+
<Box sx={{width: '100%', maxWidth: '960px', minWidth: 0}}>
112112
<Box as="main" id="skip-nav" sx={{mb: 4}}>
113113
{breadcrumbData.length > 1 ? (
114114
<Breadcrumbs sx={{mb: 4}}>

0 commit comments

Comments
 (0)