Skip to content

Scale the layout with a fluid rem root, and theme the scrollbars - #83

Open
rdehnhardt wants to merge 1 commit into
pestphp:5.xfrom
rdehnhardt:experiment/rem-clamp-fluid-scale
Open

Scale the layout with a fluid rem root, and theme the scrollbars#83
rdehnhardt wants to merge 1 commit into
pestphp:5.xfrom
rdehnhardt:experiment/rem-clamp-fluid-scale

Conversation

@rdehnhardt

Copy link
Copy Markdown

The design is already rem-based end to end, so a single fluid root scales type, spacing, radii and the blueprint grid together:

html { font-size: clamp(1rem, 0.8889vw, 2.8rem) }

Below 1800px the floor holds the root at 1rem and the rendering is pixel-identical to before; above it everything grows with the viewport. At 2560px the railed container goes from 1536px to 2185px instead of leaving a third of the screen empty. Breakpoints are unaffected — rem in a media query resolves against the initial font size, so sm:/lg: still fire at 640/1024 CSS px.

Values that must track the root are converted on a 16px basis: the --text-* tokens, the hero H1 clamps, the 56px blueprint grid and its beam script, .crosshair, and --line-height on code snippets. Decorative pixel values stay in px.

The docs sidebar, the partners rail and the landing tab bar also lost their unstyled native scrollbars. Page scroll is a thin rose-500 thumb; the navigation rails use .scrollbar-ghost, transparent until hovered.

The design is already rem-based end to end, so a single fluid root scales
type, spacing, radii and the blueprint grid together:

    html { font-size: clamp(1rem, 0.8889vw, 2.8rem) }

Below 1800px the floor holds the root at 1rem and the rendering is
pixel-identical to before; above it everything grows with the viewport.
At 2560px the railed container goes from 1536px to 2185px instead of
leaving a third of the screen empty. Breakpoints are unaffected — `rem`
in a media query resolves against the initial font size, so sm:/lg: still
fire at 640/1024 CSS px.

Values that must track the root are converted on a 16px basis: the
--text-* tokens, the hero H1 clamps, the 56px blueprint grid and its beam
script, .crosshair, and --line-height on code snippets. Decorative pixel
values stay in px.

The docs sidebar, the partners rail and the landing tab bar also lost
their unstyled native scrollbars. Page scroll is a thin rose-500 thumb;
the navigation rails use .scrollbar-ghost, transparent until hovered.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant