Skip to content

Commit 16f5c73

Browse files
committed
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
1 parent b17fcc8 commit 16f5c73

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

theme/src/components/layout.js

Lines changed: 1 addition & 1 deletion
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)