typography
The type treatment of a text element — family, size, spacing and case.
Path
…elements.<element>.styles.typography
Elements Supported
Value
TokenReference
A design token, written as a $token path plus a $type, as in { $token: Color/On surface, $type: color }. The consuming platform resolves it to a value.
$token: Type/Body/Default$type: typographyTypography
One or more typography properties, inline
fontSizefontFamilyfontStylelineHeightletterSpacingtextCasetextDecorationparagraphIndentparagraphSpacingleadingTrimlistSpacinghangingPunctuationhangingList
fontFamily: InterfontStyle: Semi BoldfontSize: 16lineHeight: 24letterSpacing: 0textCase: ORIGINALnull (default)
Themes
A TokenReference written here resolves under the theme in force on this element — the one it selects in themes, or the nearest ancestor’s. The same token path yields a different value under a different theme.
Platform bindings
Figma
Disposition: bound · Realised by: rule namedStyleVersusInline
Accepts Typography or TokenReference. A font that fails to load degrades to Inter Regular with a warning, never aborts.
CSS
Disposition: approximated · Realised by: typography
A resolvable token emits the font shorthand plus a companion letter-spacing, since the shorthand cannot carry tracking. Otherwise each member emits its own property, and fontStyle is split into font-weight and font-style. Loss: a weight word absent from the recognised map loses font-weight while italic detection still succeeds; textCase and textDecoration values outside their maps are dropped silently; and the companion letter-spacing depends on a pattern match against the resolved variable name, which if it fails loses tracking.
Decisions
- ADR-005 — Replace Typography Flat Properties with
typography— AddTypographyType - ADR-006 — Unified Token Reference Type — Replace
VariableStyleandFigmaStylewithTokenReference - ADR-032 — Typography leadingTrim — Correct to String Enum
- ADR-033 — Typography fontFamily/fontStyle — Remove Number, Add TokenReference
- ADR-075 —
conventions.primitives— a Declared Table from Styles to a Component’s Props - ADR-113 — Style defaults belong to the schema
Further reading
- ADR 005 — Replace Typography Flat Properties with Composite — consolidates 14 flat typography keys into a single composite type
- ADR 032 — Typography leadingTrim — Correct to String Enum — fixes
leadingTrimto a string enum - ADR 033 — Typography fontFamily/fontStyle — Remove Number, Add TokenReference — adds token reference support to font properties
Rules
| Rule | Statement |
|---|---|
| DSPEC-44 | Every Styles property declares a default valid against its own schema |
| DSPEC-45 | A declared default is a literal, never a reference or conditional |
Source
| Format | File |
|---|---|
| JSON Schema | packages/schema/schema/styles.schema.json |
| TypeScript | packages/schema/types/Styles.ts |
| Specification | §4.1a, §11 |