Skip to content

fix(typography): Minor typography foundation corrections - #5068

Open
oleksandrzavarzin-callstack wants to merge 1 commit into
callstack:mainfrom
oleksandrzavarzin-callstack:fix/typography-foundation-corrections
Open

fix(typography): Minor typography foundation corrections#5068
oleksandrzavarzin-callstack wants to merge 1 commit into
callstack:mainfrom
oleksandrzavarzin-callstack:fix/typography-foundation-corrections

Conversation

@oleksandrzavarzin-callstack

Copy link
Copy Markdown

Motivation

Small, foundation-level typography corrections identified while auditing the type-scale tokens against Material Design 3, as part of the v6 modernization effort. Body was on the wrong font family, seven emphasized styles were on the wrong font family, and the TypescaleKey type didn't expose the emphasized variants that the runtime object already had.

Changes

Typography tokens (src/theme/tokens/ref/typeface.ts, src/theme/tokens/sys/typography.ts)

  • Body font: MD3 assigns Body to the Plain family; the repo had it on Brand, masked by a per-style override that forced fontFamily/fontWeight back to the right values. Added a plainRegular typeface entry (Plain @ weight 400) and pointed bodyLarge/bodyMedium/bodySmall at it directly, removing the override.
  • Emphasized Display/Headline/TitleLarge font: MD3 assigns these to Brand; the repo had them on Plain (plainMedium). Added a brandMedium typeface entry (Brand @ weight 500) and repointed the seven affected emphasized styles.
  • Helper renaming: the four style-composition helpers were renamed from weight-only names (regularType, mediumType, emphasizedMediumType, emphasizedBoldType) to <family><weight>Type names (brandRegularType, brandMediumType, plainRegularType, plainMediumType, plainMediumEmphasizedType, plainBoldType). The old names hid that a single helper was shared across styles MD3 assigns to different families — which is exactly how both bugs above happened.

Types (src/theme/types/typography.ts, src/components/Typography/Text.tsx)

  • Extended TypescaleKey with the 15 *Emphasized variants so Text's variant prop type-accepts them (the runtime typescale object already had these keys — this only fixes the type).
  • Documented the Emphasized variants in Text's variant JSDoc.

Docs (docs/6.x/docs/guides/fonts.md)

Visual / behavioral changes

None

Public API

  • New: md.ref.typeface.plainRegular, md.ref.typeface.brandMedium (internal ref tokens, exported transitively via Palette/theme but not part of the documented component API).
  • Extended: TypescaleKey (and therefore Text's variant prop) now accepts 15 additional *Emphasized values that were already valid at runtime.
  • Type-level breaking change: code that hand-builds a complete Record<TypescaleKey, …> object from scratch now needs the 15 additional keys. configureFonts is unaffected — all its overloads take Partial<Record<TypescaleKey, …>>.

Related issue

(new — to be created)

Note on scope: the emphasized Display/Headline/TitleLarge family fix is included here rather than deferred, because Compose's generated TypeScaleTokens.kt (VERSION: v0_103) marks all 15 *Emphasized entries provisional under a single // TODO update with the generated tokens once available comment — but the family assignment (Brand vs Plain) mirrors the non-emphasized baseline split 1:1 and matches the M3 type-scale spec, so it's a low-risk read even while flagged provisional upstream. Only the family was touched; sizes/line-heights/tracking are untouched.

Test plan

  • yarn typescript (tsc -b)
  • yarn lint
  • yarn test — 55 suites / 733 tests / 169 snapshots pass, no snapshot changes
  • New regression test asserts Android font-family/weight resolution for Body and emphasized Display/Headline/TitleLarge
  • Confirmed byte-identical resolved typescale output (ios/android/web) between main and this branch — no visual verification needed since there is no rendering change

@oleksandrzavarzin-callstack oleksandrzavarzin-callstack changed the title fix: align typography system with Material Design 3 updates Minor typography foundation corrections Aug 24, 2026

@JKobrynski JKobrynski left a comment

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM!

@oleksandrzavarzin-callstack oleksandrzavarzin-callstack changed the title Minor typography foundation corrections fix: Minor typography foundation corrections Aug 24, 2026
@oleksandrzavarzin-callstack oleksandrzavarzin-callstack changed the title fix: Minor typography foundation corrections fix(Typography): Minor typography foundation corrections Aug 24, 2026
@oleksandrzavarzin-callstack oleksandrzavarzin-callstack changed the title fix(Typography): Minor typography foundation corrections fix(typography): Minor typography foundation corrections Aug 24, 2026
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.

2 participants