fix: size the module grid by its container, not the window - #81
Merged
Conversation
The package cards on /en/packages/ and /en/reference/ were squeezed to 221px (200px at a 1280px window, where the longest package names broke across three lines mid-word), while the same component on the home page looked right at 385px. The grid asked a viewport media query how many columns to draw, but the two usages sit in very different boxes: the home page gives it the full 1180px section, the documentation pages put it inside the 688px content column. A wide window therefore handed the narrow column a three-column grid. The grid now answers to its own container. The thresholds are the container widths the old viewport breakpoints worked out to, so the home page keeps the layout it had -- verified identical at nine viewport widths from 1600 down to 375 -- while the documentation pages drop to two columns and 338px cards. A scan of every page at four viewport widths found no other multi-column layout inside the documentation column whose column count came from a viewport query; the remaining narrow columns are all home-page sections in a 1180px box, where they are intended. Co-Authored-By: Claude Opus 5 (1M context) <noreply@anthropic.com>
intech
force-pushed
the
fix/module-grid-container-width
branch
from
August 6, 2026 16:43
505aecd to
f9c312a
Compare
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.
Problem
The package cards on
/en/packages/and/en/reference/render squeezed, while the same component on the home page looks right./en/packages/, 1440px window/en/packages/, 1280px windowCause
The grid asked a viewport media query how many columns to draw, but the component appears in two very different boxes: the home page gives it the full 1180px section, while the documentation pages put it inside the 688px content column. A viewport query cannot tell those apart, so a wide window handed the narrow column a three-column grid. The breakpoints that would have dropped it to two columns only fire when the window shrinks — which also shrinks the documentation column, so they never help.
Fix
The grid now answers to its own container, via
container-type: inline-sizeon.module-groupsand@containerbreakpoints. The two thresholds are the container widths the old viewport breakpoints worked out to, so the home page keeps exactly the layout it has today.The old viewport rules for
.module-gridare removed; the other selectors in those media queries are untouched.Result
/en/packages/,/en/reference/at 1600 / 1440px/en/packages/,/en/reference/at 1280 / 1024pxValidation
pnpm docs:buildandpnpm docs:validate:builtpass, as doespnpm docs:validateon sources. The@containerrules andcontainer-typesurvive the production CSS pipeline, and the built output measures identically to dev.Column count and card width were measured on all three pages that use the grid, at nine viewport widths from 1600 down to 375, before and after. The home page is identical to its current behaviour at every one of them; only the two documentation pages change.
Separately, every page was scanned at four viewport widths for any other multi-column layout inside the documentation column whose column count came from a viewport query.
.module-gridwas the only one. The remaining narrow columns all belong to home-page sections in a 1180px box, where they are intended.Without
@containersupport a browser falls back to a single column rather than a broken layout. The feature has been available in all major browsers since 2022–2023.🤖 Generated with Claude Code