Design system / Typography
CreativeXHub design system
Typography
Fluid font sizes, semantic text roles and independently selected line height, font family and color.
Purpose-driven roles
Select a typography role by content purpose: body, supporting, label, eyebrow or title. Semantic size tokens reference the fluid scale in src/theming/primitives/typography.css. Select HTML elements separately to preserve headings, labels, lists and other document semantics.
These specimens use actual semantic typography utilities.
text-bodyBody copy — semantic role specimen.
text-supportingSupporting explanation — semantic role specimen.
text-labelPersistent field label — semantic role specimen.
text-eyebrowEyebrow / metadata — semantic role specimen.
text-titleSection title — semantic role specimen.
text-secondary-title-jumboPage / secondary display title — semantic role specimen.
text-title-jumboPrimary display title — semantic role specimen.
A semantic token and its utility class are separate contracts. Both display-title tokens have registered utilities. The secondary-title alias has no matching named utility. When a role fits the content, use its supported utility instead of a generic scale step.
text-title-jumbo selects the primary display size. text-secondary-title-jumbo selects the smaller display size used by documentation PageHeading. Both respond continuously to viewport width through their fluid tokens. Use generic text-jumbo, text-6xl or text-5xl for scale specimens or content without a suitable semantic role.
Monospace accent
To select a monospace font family, use the Text atom's accent="monospace" prop. Numeric and lettered indices are common uses. The accent changes font family only; it retains the selected fluid size and reading rhythm.
Real Text atom: matching size roles, independently selected family accent.
No family accent
body01 · A · A shared language.
supporting01 · A · A shared language.
eyebrow01 · A · A shared language.
Monospace accent
body01 · A · A shared language.
supporting01 · A · A shared language.
eyebrow01 · A · A shared language.
<Text accent="monospace">Body-sized accent</Text>
<Text variant="supporting" accent="monospace" rhythm="loose">Supporting accent</Text>
<Text as="span" variant="eyebrow" accent="monospace" aria-hidden>01</Text>
<Text as="span" variant="eyebrow" accent="monospace">A</Text>The family alias --font-family-monospace-accent resolves the existing system-monospace primitive. The Tailwind bridge exposes font-monospace-accent, and Text owns its prop-to-style mapping. Accent defaults to none, leaving the owner's font family intact. It does not imply code semantics, a heading, bold weight, color, tracking or a new reading rhythm. Keep a meaningful index accessible; use aria-hidden only when it is decorative beside a complete label, as in this documentation's navigation.
Select the accent on text owned by the caller. Do not apply a global selector to another component's indices or labels. A scoped override of the semantic family token changes accented text without adding a size scale. The eyebrow variant's weight and tracking remain independent.
Supporting text color
For supporting text color, select text-text-muted on the text element. This utility resolves --text-muted: neutral-600 in the base light theme and neutral-400 in the base dark theme. Text's supporting variant selects size, not color. Existing shadcn foreground tokens remain separate compatibility contracts.
Real Text/native text roles on actual background and muted surfaces; the root mode controls this base-theme specimen.
Readable supporting copy on this surface.
The same color role with body-sized text.
01 · Independent family and rhythm
Native text can select the same color role.
Readable supporting copy on this surface.
The same color role with body-sized text.
01 · Independent family and rhythm
Native text can select the same color role.
<Text variant="supporting" className="text-text-muted">Supporting copy</Text>
<Text className="text-text-muted">Same color, body size</Text>The Slate tenant preset selects the same neutral text-color token; custom palettes inherit that choice. Ocean and Orchid retain their own text-color overrides. The Themes page exercises the production preset/custom functions on card and muted surfaces. Those existing scoped palettes remain light palettes even when the surrounding documentation root is dark; this change does not invent dark variants.
Select color, size, rhythm and family independently. Typography tokens such as --text-body describe size despite the shared --text- prefix. In particular, text-secondaryis a color utility, while text-supporting selects the size alias --text-secondary. Do not substitute one for the other.
Shared eyebrow treatment
The eyebrow role uses the fluid xs size, semibold weight and .12em tracking. Use Text variant="eyebrow" or the native text-eyebrow utility. Theme tokens define the defaults; explicit size, weight and tracking overrides remain supported. The caller owns casing, color and placement.
Real Text contract and existing native semantic utility; independent overrides are deliberate, not alternative defaults.
Shared eyebrow default
01 · AExisting native eyebrow consumer
Independent size and rhythm
Explicit normal emphasis and family
Responsive owner override
Ordinary body text keeps its existing treatment.
| Purpose | Semantic token | Selection |
|---|---|---|
| Existing fluid size | --text-eyebrow → --cxh-type-size-xs | Text variant="eyebrow" / text-eyebrow |
| Semibold emphasis | --text-eyebrow--font-weight → --cxh-font-weight-semibold | font-eyebrow; explicit font-normal/font-medium overrides remain supported |
| Expanded tracking | --letter-spacing-eyebrow → --cxh-letter-spacing-expanded | tracking-eyebrow; explicit tracking utilities remain supported |
| Independent rhythm/family | Existing reading-rhythm and family-accent aliases | rhythm and accent props do not change eyebrow weight/tracking |
PageHeading uses the shared Text eyebrow variant. Other consumers can retain explicit weight or tracking through their supported className contract. There is no separate Eyebrow component in the current system; use Text rather than assuming a proposed convenience wrapper exists.
Reading rhythms
Reading rhythm selects line height independently of font size. Text defaults to rhythm="tight"; use rhythm="loose" for sustained reading. Both rhythms use unitless theme values and can appear on the same page. ADR-0086 permits value tuning without changing ADR-0034's fluid-size contract.
Real Text atom; same fluid roles, independent rhythm props; current theme values.
Tight
rhythm="tight"Reading rhythm changes line height without changing font size. Select it on this text element; nearby controls retain their own typography and layout contracts.
Supporting explanations can choose the same rhythm without becoming primary body text.
Loose
rhythm="loose"Reading rhythm changes line height without changing font size. Select it on this text element; nearby controls retain their own typography and layout contracts.
Supporting explanations can choose the same rhythm without becoming primary body text.
<Text rhythm="loose">Reading copy</Text>
<Text rhythm="tight">Compact copy</Text>
<Text as="li" variant="supporting" rhythm="loose">Supporting list item</Text>Select rhythm on the Text element owned by the caller. Do not use a page-wide selector to change nested controls or specimens. A plain font-size override retains Text's selected rhythm; an explicit leading utility or size/leading postfix can override it deliberately.
src/components/ui/text.tsx| Prop | Intent / default | Boundary |
|---|---|---|
| rhythm | tight by default; loose for sustained reading | Selects line height only; does not change size, spacing or nearby controls. |
| variant | body by default; supporting for secondary copy; eyebrow for small indices/metadata with semantic weight/tracking; inherit to retain an owner's existing size | Fluid size and eyebrow emphasis are independent of reading rhythm and family accent; explicit overrides remain supported. |
| accent | none by default; monospace for numeric/lettered indices and deliberate accents | Changes font family only; reuses the selected size role 1:1, with no new font download. |
| as | p by default; span, div, li or dd when that native element fits | No extra wrapper. Lists and definitions retain their HTML semantics; do not nest a paragraph inside a paragraph. |
| className / native props | Standard shadcn-style customization and native element attributes | Use supported contracts; deliberate overrides affect this text element, not descendants of other components. |
| Component choice | Internal utility | Semantic token |
|---|---|---|
| rhythm="tight" | leading-compact | --reading-rhythm-tight |
| rhythm="loose" | leading-prose | --reading-rhythm-loose |
Text is a product-neutral atom, not a new theme or a client component. Theme primitives own adjustable unitless values; semantic aliases name their intent; the Tailwind bridge registers the internal utilities. The atom owns the prop-to-style mapping, and the content owner chooses the props. Public reading copy prefers loose; dense interface copy retains tight unless its owner deliberately opts in. No route-wide rhythm provider, Context or descendant selector is needed.
src/theming/primitives/typography.csssrc/theming/semantics/typography.csssrc/theming/utilities/generated.cssdocs/decisions/ADR-0086-semantic-reading-rhythms.mdFluid scale
Semantic names describe content purpose; primitive step names describe relative size. The table maps supported roles to scale steps. Some steps have no semantic role, and some aliases have no registered utility. Monospace accent changes family without changing these mappings.
| Semantic intent | Size token / role | Fluid step | Supported selection |
|---|---|---|---|
| Body copy | --text-body | md | Text variant="body" / text-body |
| Supporting explanation | --text-secondary | sm | Text variant="supporting" / text-supporting (text-secondary is a color utility) |
| Persistent field label | --text-label | sm | text-label on the appropriate native label |
| Eyebrow / small index | --text-eyebrow | xs | Text variant="eyebrow" / text-eyebrow |
| Section title | --text-title | xl | text-title on the appropriate native heading |
| Secondary title alias | --text-secondary-title | lg | Token reference; no matching named utility registered |
| Primary display title | --text-title-jumbo | jumbo | text-title-jumbo |
| Secondary display / documentation page title | --text-secondary-title-jumbo | 5xl | text-secondary-title-jumbo |
| Scale-only sizes | --cxh-type-size-2xl / 3xl / 4xl | 2xl / 3xl / 4xl | Generic scale utilities when no stable semantic role applies |
| Monospace accent | --font-family-monospace-accent + selected size role | Same step as the chosen role | Text accent="monospace"; body defaults to md, supporting to sm, eyebrow to xs |
The medium step interpolates from 14.5px at 360px to 18px at 2560px. Every other step derives from medium with a 1.2 ratio. Resize the viewport: the same CSS drives these previews and the application. The root rem base remains 10px; familiar spacing utilities keep their pixel sizes.
xs · CreativeXHub
sm · CreativeXHub
md · CreativeXHub
lg · CreativeXHub
xl · CreativeXHub
2xl · CreativeXHub
3xl · CreativeXHub
4xl · CreativeXHub
5xl · CreativeXHub
jumbo · CreativeXHub
| Token | Declaration | Mode / source |
|---|---|---|
--cxh-font-sans | ui-sans-serif, system-ui, sans-serif | light src/theming/primitives/typography.css |
--cxh-font-mono | ui-monospace, monospace | light src/theming/primitives/typography.css |
--cxh-type-size-md | clamp(1.45rem, calc(1.3927rem + 0.1591vw), 1.8rem) | light src/theming/primitives/typography.css |
--cxh-type-size-xs | calc(var(--cxh-type-size-md) / 1.44) | light src/theming/primitives/typography.css |
--cxh-type-size-sm | calc(var(--cxh-type-size-md) / 1.2) | light src/theming/primitives/typography.css |
--cxh-type-size-lg | calc(var(--cxh-type-size-md) * 1.2) | light src/theming/primitives/typography.css |
--cxh-type-size-xl | calc(var(--cxh-type-size-md) * 1.44) | light src/theming/primitives/typography.css |
--cxh-type-size-2xl | calc(var(--cxh-type-size-md) * 1.728) | light src/theming/primitives/typography.css |
--cxh-type-size-3xl | calc(var(--cxh-type-size-md) * 2.0736) | light src/theming/primitives/typography.css |
--cxh-type-size-4xl | calc(var(--cxh-type-size-md) * 2.48832) | light src/theming/primitives/typography.css |
--cxh-type-size-5xl | calc(var(--cxh-type-size-md) * 2.985984) | light src/theming/primitives/typography.css |
--cxh-type-size-jumbo | calc(var(--cxh-type-size-md) * 3.583181) | light src/theming/primitives/typography.css |
--cxh-type-line-height-tight | 1.4 | light src/theming/primitives/typography.css |
--cxh-type-line-height-loose | 1.6 | light src/theming/primitives/typography.css |
--cxh-type-line-height-heading | 1.1 | light src/theming/primitives/typography.css |
--cxh-type-line-height-title | 1.2 | light src/theming/primitives/typography.css |
--cxh-type-line-height-body | var(--cxh-type-line-height-tight) | light src/theming/primitives/typography.css |
--cxh-type-line-height-label | 1.2 | light src/theming/primitives/typography.css |
--cxh-font-weight-light | 300 | light src/theming/primitives/typography.css |
--cxh-font-weight-normal | 400 | light src/theming/primitives/typography.css |
--cxh-font-weight-medium | 500 | light src/theming/primitives/typography.css |
--cxh-font-weight-semibold | 600 | light src/theming/primitives/typography.css |
--cxh-font-weight-bold | 700 | light src/theming/primitives/typography.css |
--cxh-letter-spacing-tighter | -0.05em | light src/theming/primitives/typography.css |
--cxh-letter-spacing-tight | -0.025em | light src/theming/primitives/typography.css |
--cxh-letter-spacing-normal | 0 | light src/theming/primitives/typography.css |
--cxh-letter-spacing-wide | 0.025em | light src/theming/primitives/typography.css |
--cxh-letter-spacing-wider | 0.05em | light src/theming/primitives/typography.css |
--cxh-letter-spacing-expanded | 0.12em | light src/theming/primitives/typography.css |
Role declarations
| Token | Declaration | Mode / source |
|---|---|---|
--reading-rhythm-tight | var(--cxh-type-line-height-tight) | light src/theming/semantics/typography.css |
--reading-rhythm-loose | var(--cxh-type-line-height-loose) | light src/theming/semantics/typography.css |
--font-family-monospace-accent | var(--cxh-font-mono) | light src/theming/semantics/typography.css |
--text-body | var(--cxh-type-size-md) | light src/theming/semantics/typography.css |
--text-body--line-height | var(--cxh-type-line-height-body) | light src/theming/semantics/typography.css |
--text-secondary | var(--cxh-type-size-sm) | light src/theming/semantics/typography.css |
--text-secondary--line-height | var(--cxh-type-line-height-body) | light src/theming/semantics/typography.css |
--text-label | var(--cxh-type-size-sm) | light src/theming/semantics/typography.css |
--text-label--line-height | var(--cxh-type-line-height-label) | light src/theming/semantics/typography.css |
--text-eyebrow | var(--cxh-type-size-xs) | light src/theming/semantics/typography.css |
--text-eyebrow--line-height | var(--cxh-type-line-height-label) | light src/theming/semantics/typography.css |
--text-eyebrow--font-weight | var(--cxh-font-weight-semibold) | light src/theming/semantics/typography.css |
--letter-spacing-eyebrow | var(--cxh-letter-spacing-expanded) | light src/theming/semantics/typography.css |
--text-title | var(--cxh-type-size-xl) | light src/theming/semantics/typography.css |
--text-title--line-height | var(--cxh-type-line-height-title) | light src/theming/semantics/typography.css |
--text-secondary-title | var(--cxh-type-size-lg) | light src/theming/semantics/typography.css |
--text-secondary-title--line-height | var(--cxh-type-line-height-title) | light src/theming/semantics/typography.css |
--text-title-jumbo | var(--cxh-type-size-jumbo) | light src/theming/semantics/typography.css |
--text-title-jumbo--line-height | var(--cxh-type-line-height-heading) | light src/theming/semantics/typography.css |
--text-secondary-title-jumbo | var(--cxh-type-size-5xl) | light src/theming/semantics/typography.css |
--text-secondary-title-jumbo--line-height | var(--cxh-type-line-height-heading) | light src/theming/semantics/typography.css |