Typography
Typography is system-first by default. Heading roles combine size, tight line
height, emphasis, and restrained tracking without requiring a web font. This
documentation site keeps that default and does not import @combric/fonts.
Optional Fontsource preset
Consumer applications can opt into the official Fontsource preset when they want its self-hosted variable-font defaults:
npm install @combric/fonts@1.5.1Import the preset last, after every other Combric stylesheet used by the application. It reassigns the typography primitives after token imports:
@import "@combric/react/css";@import "@combric/menu/css";/* Import any other Combric CSS before the preset. */@import "@combric/fonts/css";The preset uses Fontsource to emit self-hosted WOFF2 assets for Inter Variable
and JetBrains Mono Variable. Its sans fallback is "Inter Variable", Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, sans-serif; its
monospace fallback starts with "JetBrains Mono Variable", ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas, monospace. The bundled faces use
font-display: swap, so verify the intended FOUT and layout stability in the
consumer build. The preset supplies normal variable faces; add an explicit
italic face if a product needs one.
Local, Google, Adobe, or another provider
Choose one provider path. For a local font, Google Fonts, Adobe Fonts, or any other provider, omit the preset and override both primitives after the Combric CSS. This avoids ambiguous family names, duplicate requests, and unnecessary Fontsource assets:
@import "@combric/react/css";/* Leave out: @import "@combric/fonts/css"; */
@font-face { font-family: "Brand Sans"; src: url("/fonts/brand-sans.woff2") format("woff2"); font-display: swap;}
:root { --combric-primitive-font-family-sans: "Brand Sans", ui-sans-serif, system-ui, sans-serif; --combric-primitive-font-family-mono: "Brand Mono", ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;}For Google Fonts, Adobe Fonts, or another hosted provider, load only that
provider’s approved stylesheet or embed method, then apply the same two
primitive overrides in your application CSS. Check the provider licence,
privacy terms, Content Security Policy, cache policy, and the MIME type for
locally served WOFF2 assets. Do not combine a provider face named Inter Variable
or JetBrains Mono Variable with @combric/fonts unless duplicated assets are an
intentional product decision.
| Kind | Token | Value / reference | CSS variable |
|---|---|---|---|
| Primitive | font.family.mono | ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas, monospace | --combric-primitive-font-family-mono |
| Primitive | font.family.sans | Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, sans-serif | --combric-primitive-font-family-sans |
| Primitive | font.size.2xl | 2rem | --combric-primitive-font-size-2xl |
| Primitive | font.size.lg | 1.25rem | --combric-primitive-font-size-lg |
| Primitive | font.size.md | 1rem | --combric-primitive-font-size-md |
| Primitive | font.size.sm | 0.875rem | --combric-primitive-font-size-sm |
| Primitive | font.size.xl | 1.5rem | --combric-primitive-font-size-xl |
| Primitive | font.size.xs | 0.75rem | --combric-primitive-font-size-xs |
| Primitive | font.weight.bold | 700 | --combric-primitive-font-weight-bold |
| Primitive | font.weight.medium | 500 | --combric-primitive-font-weight-medium |
| Primitive | font.weight.regular | 400 | --combric-primitive-font-weight-regular |
| Primitive | font.weight.semibold | 600 | --combric-primitive-font-weight-semibold |
| Primitive | letter.spacing.normal | 0 | --combric-primitive-letter-spacing-normal |
| Primitive | letter.spacing.tight | -0.01em | --combric-primitive-letter-spacing-tight |
| Primitive | line.height.body | 1.5 | --combric-primitive-line-height-body |
| Primitive | line.height.relaxed | 1.65 | --combric-primitive-line-height-relaxed |
| Primitive | line.height.tight | 1.2 | --combric-primitive-line-height-tight |
| Semantic | font.family.body | font.family.sans → Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, sans-serif | --combric-font-family-body |
| Semantic | font.family.code | font.family.mono → ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas, monospace | --combric-font-family-code |
| Semantic | font.size.body | font.size.md → 1rem | --combric-font-size-body |
| Semantic | font.size.heading.lg | font.size.2xl → 2rem | --combric-font-size-heading-lg |
| Semantic | font.size.heading.md | font.size.xl → 1.5rem | --combric-font-size-heading-md |
| Semantic | font.size.heading.sm | font.size.lg → 1.25rem | --combric-font-size-heading-sm |
| Semantic | font.size.small | font.size.sm → 0.875rem | --combric-font-size-small |
| Semantic | font.weight.body | font.weight.regular → 400 | --combric-font-weight-body |
| Semantic | font.weight.emphasis | font.weight.semibold → 600 | --combric-font-weight-emphasis |
| Semantic | letter.spacing.heading | letter.spacing.tight → -0.01em | --combric-letter-spacing-heading |
| Semantic | line.height.body | line.height.body → 1.5 | --combric-line-height-body |
| Semantic | line.height.heading | line.height.tight → 1.2 | --combric-line-height-heading |
