feat: update font scale - #682
Open
FBalint wants to merge 4 commits into
Open
Conversation
commit: |
Contributor
Docs PreviewCommit: |
Contributor
FBalint
force-pushed
the
balint/font-scale
branch
2 times, most recently
from
July 31, 2026 13:51
3014b1f to
923f0ba
Compare
added 3 commits
August 3, 2026 12:38
The refreshed typography scale used conventional 1.45-1.5 ratios which loosened text-sm and text-base line-heights by ~2-4px vs. the old scale's tight ratios (1/0.85 for sm, 1.5 with 14px base). Surfaces that swapped from text-sm to text-base (Sidebar, TableOfContents) were most affected. - sm ratio 1.45 -> 1.35 (12px * 1.35 = 16.2px) - base ratio 1.5 -> 1.4 (13px * 1.4 = 18.2px) - lg ratio 1.5 -> 1.45 (15px * 1.45 ~ 21.75px) xs / xl / 2xl unchanged.
FBalint
force-pushed
the
balint/font-scale
branch
from
August 3, 2026 11:45
c8c7c3b to
5a8ba61
Compare
FBalint
marked this pull request as ready for review
August 3, 2026 11:50
…iants Use the new role-based Text API introduced in this branch instead of ad-hoc className overrides: - Body-context font-medium → `<Text bold>` - Heading-context (`as="h3"` + font-medium) → `<Text variant="heading">` - Sized emphasis (`size="sm"` + font-medium) → `<Text size="sm" bold>` Applies to GridDemo, design-tips (font-weight and layer-card-nesting good/bad examples), and the changelog section headers. Anti-pattern demonstrations (`font-bold`, `uppercase`) intentionally left as DANGEROUS_className since that's the point of those examples.
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.



























































































































Font scale refresh
Body baseline moves 14px → 13px.
text-smwas the de-facto default across the library and downstream usage; renaming so the most-used size is calledbase. New scale:text-xs/sm/base/lg/xl/2xl= 11/12/13/15/19/24px.--font-scaleCSS multiplier. For products that want a user-facing "bigger text" preference:remonly for font-size. It doesn't — Tailwind emitsremfor spacing (padding, margin, gap), so those scale too.--font-scalemultiplies only font-size tokens. Every font-size is emitted ascalc(<px> * var(--font-scale, 1)). Consumers override at any scope; spacing stays put.Full separation of type and layout scaling requires a
rem-for-font /px-for-spacing convention shift. Out of scope here; this PR lands the infrastructure.Em-relative icon sizing. Icons across ~20 components moved from hardcoded pixels (
size={12},h-4 w-4) to em ratios, following Apple's font scaling pattern — a UI icon is a glyph in its text's context and scales with the surrounding font-size. This:--font-scaleautomatically.Ratios in use:
1em(bare)0.85em1.15em1.25emvar(--text-lg)What's in it
Textvariants:display(24px semibold),page-title(19px medium),section-title(15px medium),heading(13px medium).heading1/2/3soft-deprecated.Text.size="xs"andsize="lg"on body variants soft-deprecated.boldnarrowed to copy variants only.sm= 26px /text-sm,base= 32px /text-base,lg= 36px /text-base.xsdeprecated across all of them.--font-scalemultiplier on every font-size token.sm/base/lg= 1.35/1.4/1.45) so dense components keep their dense feel.Changesets
14 changesets. Aggregated bump:
minor.text-role-based-variantsTextdeprecationsbutton-sizes-refreshxsdeprecationform-controls-size-refreshbanner-typography-weight-firstfont-scale-multiplier--font-scaleCSS varicons-em-relative-sizingtoken-refresh-class-swapsline-height-ratios-tightensm/base/lgline-height ratios tightenedtoolbar-deprecate-xsxsdeprecation with single-warning remapbanner-action-sm-sizeBanner.Actionsize narrowed to"sm"collapsible-trigger-text-baselabel-tooltip-button-smxs → smtable-header-weightsemibold → medium; compact headerxs → smtoast-typography-role-basedFigma plugin is out of sync with the library. Sources:
packages/kumo-figma/src/build-theme-data.ts) — updated to handle the newcalc(<px> * var(--font-scale, 1))wrapper. Working.KUMO_*_STYLINGmetadata — updated for control-size changes butKUMO_TEXT_STYLING.fontSizes.xlstill reads17, needs19.pnpm --filter @cloudflare/kumo-figma testfails with 22 tests acrosstailwind-to-figma, drift-detection, and generator snapshots. Build still succeeds.Testing
pnpm typecheckclean.pnpm lintclean.FontScaleTogglemanually exercised.