Skip to documentation

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.

Live preview

These specimens use actual semantic typography utilities.

text-body

Body copy — semantic role specimen.

text-supporting

Supporting explanation — semantic role specimen.

text-label

Persistent field label — semantic role specimen.

text-eyebrow

Eyebrow / metadata — semantic role specimen.

text-title

Section title — semantic role specimen.

text-secondary-title-jumbo

Page / secondary display title — semantic role specimen.

text-title-jumbo

Primary 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.

Live preview

Real Text atom: matching size roles, independently selected family accent.

No family accent

body

01 · A · A shared language.

supporting

01 · A · A shared language.

eyebrow

01 · A · A shared language.

Monospace accent

body

01 · A · A shared language.

supporting

01 · A · A shared language.

eyebrow

01 · 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.

Live preview

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.

src/theming/semantics/text.csssrc/theming/tenantThemes.ts

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.

Live preview

Real Text contract and existing native semantic utility; independent overrides are deliberate, not alternative defaults.

Shared eyebrow default

01 · A

Existing native eyebrow consumer

Independent size and rhythm

Explicit normal emphasis and family

Responsive owner override

Ordinary body text keeps its existing treatment.

Eyebrow theme mapping
PurposeSemantic tokenSelection
Existing fluid size--text-eyebrow → --cxh-type-size-xsText variant="eyebrow" / text-eyebrow
Semibold emphasis--text-eyebrow--font-weight → --cxh-font-weight-semiboldfont-eyebrow; explicit font-normal/font-medium overrides remain supported
Expanded tracking--letter-spacing-eyebrow → --cxh-letter-spacing-expandedtracking-eyebrow; explicit tracking utilities remain supported
Independent rhythm/familyExisting reading-rhythm and family-accent aliasesrhythm 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.

Live preview

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
Text atom typography contract
PropIntent / defaultBoundary
rhythmtight by default; loose for sustained readingSelects line height only; does not change size, spacing or nearby controls.
variantbody by default; supporting for secondary copy; eyebrow for small indices/metadata with semantic weight/tracking; inherit to retain an owner's existing sizeFluid size and eyebrow emphasis are independent of reading rhythm and family accent; explicit overrides remain supported.
accentnone by default; monospace for numeric/lettered indices and deliberate accentsChanges font family only; reuses the selected size role 1:1, with no new font download.
asp by default; span, div, li or dd when that native element fitsNo extra wrapper. Lists and definitions retain their HTML semantics; do not nest a paragraph inside a paragraph.
className / native propsStandard shadcn-style customization and native element attributesUse supported contracts; deliberate overrides affect this text element, not descendants of other components.
Reading rhythm theme mapping
Component choiceInternal utilitySemantic 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.md

Fluid 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 typography names and fluid scale mappings
Semantic intentSize token / roleFluid stepSupported selection
Body copy--text-bodymdText variant="body" / text-body
Supporting explanation--text-secondarysmText variant="supporting" / text-supporting (text-secondary is a color utility)
Persistent field label--text-labelsmtext-label on the appropriate native label
Eyebrow / small index--text-eyebrowxsText variant="eyebrow" / text-eyebrow
Section title--text-titlexltext-title on the appropriate native heading
Secondary title alias--text-secondary-titlelgToken reference; no matching named utility registered
Primary display title--text-title-jumbojumbotext-title-jumbo
Secondary display / documentation page title--text-secondary-title-jumbo5xltext-secondary-title-jumbo
Scale-only sizes--cxh-type-size-2xl / 3xl / 4xl2xl / 3xl / 4xlGeneric scale utilities when no stable semantic role applies
Monospace accent--font-family-monospace-accent + selected size roleSame step as the chosen roleText 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

Current token declarations from repository CSS. Swatches resolve the active documentation mode.
TokenDeclarationMode / 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

Current token declarations from repository CSS. Swatches resolve the active documentation mode.
TokenDeclarationMode / 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
docs/decisions/ADR-0034-fluid-typography-scale-and-semantic-contract.md
Current components and theme tokens. Fictional example data. Source views refresh on deployment; authors maintain contract notes.