Skip to content

feat!: rework typography around a polymorphic Text component - #1152

Draft
pawelgrimm wants to merge 12 commits into
mainfrom
pawel/feat/typography-updates
Draft

feat!: rework typography around a polymorphic Text component#1152
pawelgrimm wants to merge 12 commits into
mainfrom
pawel/feat/typography-updates

Conversation

@pawelgrimm

@pawelgrimm pawelgrimm commented Aug 12, 2026

Copy link
Copy Markdown
Contributor

Short description

  • Rework Text into a single polymorphic typography component: one variant prop covering the full Figma scale (display-*, heading-*, subheader, body, callout, caption, footnote).
  • Heading variants render the matching heading element (heading-1h1, …); all other variants render div. render overrides the element in every case.
  • Remove Heading; heading typography now comes from Text heading variants.
  • Add Storybook docs and expanded tests.

PR Checklist

  • Added tests for bugs / new features
  • Updated docs (storybooks, readme)
  • Reviewed and approved Chromatic visual regression tests in CI

@pawelgrimm
pawelgrimm force-pushed the pawel/feat/typography-updates branch from 438db49 to 957f289 Compare August 12, 2026 21:10
@pawelgrimm pawelgrimm changed the title feat!: update typography components feat!: rework typography around a polymorphic Text component Aug 12, 2026
@pawelgrimm pawelgrimm self-assigned this Aug 12, 2026
@pawelgrimm pawelgrimm added the 🙋 Ask PR Used for PRs that need a review before merging. label Aug 12, 2026
@pawelgrimm
pawelgrimm force-pushed the pawel/feat/typography-updates branch 2 times, most recently from 5997e45 to fe534c0 Compare August 12, 2026 21:34
Text now covers the full typography scale with a single variant prop:
display-*, heading-*, subheader, body, callout, caption, and footnote
styles from the Figma reference. Heading variants render the matching
heading element and all other variants render a div; use render to
override the element.

BREAKING CHANGE: Text no longer accepts size, weight, or as props.
Pick a variant instead, and use render for custom elements.
BREAKING CHANGE: Heading is removed. Use Text with a heading variant,
e.g. <Heading level={2}> becomes <Text variant="heading-2">, which
renders an h2. Use render to decouple semantics from the visual style.
@pawelgrimm
pawelgrimm force-pushed the pawel/feat/typography-updates branch from fe534c0 to 4c4e703 Compare August 12, 2026 21:36
Move the SF web font stack to design-tokens.css and use literal font
weights in the variant classes, matching their literal px sizes. Removes
the module-local :root tokens whose 'medium' (500) collided with the
canonical --reactist-font-weight-medium (600).
Inline getTextClassName into Text — its options-object API was a fossil
of the deleted typography layer with a single caller. Replace heading
element string-building with a plain lookup map.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

🙋 Ask PR Used for PRs that need a review before merging.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant