Skip to main content

Core Typography

Core typography tokens define the fundamental text properties that create consistent and accessible typography across our design system.

Font Families

Core font families establish the typographic voice of your brand:

TokenFont FamilyPurpose
core.fonts.body"Atkinson Hyperlegible", sans-serifBody text, optimized for readability
core.fonts.heading"Work Sans", sans-serifHeadings and titles
core.fonts.mono"Inconsolata", sans-serifCode and monospaced content

Usage Example

<Text sx={{ fontFamily: 'body' }}>
Readable body text using Atkinson Hyperlegible
</Text>

<Heading sx={{ fontFamily: 'heading' }}>
Heading using Work Sans
</Heading>

Font Sizes

Harmonious scale for all text sizes:

TokenValueremUsage
4xs6px0.375remFine print, captions
3xs8px0.5remSmall labels
2xs10px0.625remSecondary text
xs12px0.75remSmall text
sm14px0.875remSmall body text
md16px1remBase body text
lg18px1.125remLarge body text
xl20px1.25remSmall headings
2xl24px1.5remMedium headings
3xl30px1.875remLarge headings
4xl36px2.25remXL headings
5xl48px3remDisplay text
6xl60px3.75remHero text

Font Weights

Consistent weight scale for emphasis and hierarchy:

TokenValueUsage
thin100Ultra-light text
extralight200Very light text
light300Light text
normal400Default body text
medium500Emphasis
semibold600Strong emphasis
bold700Headings
extrabold800Strong headings
black900Display text

Letter Spacing

Fine-tune character spacing for readability:

TokenValueUsage
tighter-0.05emTight headlines
tight-0.025emSlightly tight
normal0emDefault spacing
wide0.025emComfortable reading
wider0.05emVery readable
widest0.1emDisplay text

Line Heights

Vertical rhythm for optimal readability:

TokenValueUsage
xs1emVery tight
sm1.25emTight
base1.5emDefault body text
lg1.625emComfortable
xl2emVery comfortable
2xl2.25emSpacious

Complete Typography Implementation

In Theme Configuration

const coreFonts = {
body: '"Atkinson Hyperlegible", sans-serif',
heading: '"Work Sans", sans-serif',
mono: '"Inconsolata", sans-serif',
};

const fontSizes = {
'4xs': '0.375rem', // 6px
'3xs': '0.5rem', // 8px
// ... rest of scale
'6xl': '3.75rem', // 60px
};

const fontWeights = {
thin: 100,
extralight: 200,
light: 300,
normal: 400,
medium: 500,
semibold: 600,
bold: 700,
extrabold: 800,
black: 900,
};

Component Usage

// Using typography tokens in components
<Text sx={{
fontFamily: 'body',
fontSize: 'md',
fontWeight: 'normal',
lineHeight: 'base',
letterSpacing: 'normal'
}}>
Optimized body text
</Text>

<Heading sx={{
fontFamily: 'heading',
fontSize: '3xl',
fontWeight: 'bold',
lineHeight: 'sm',
letterSpacing: 'wide'
}}>
Heading with proper spacing
</Heading>

Typography Scale Relationships

Our scale follows mathematical relationships for visual harmony:

Base size (md: 16px) serves as the foundation, with other sizes creating harmonious relationships.

Accessibility Considerations

Our typography tokens ensure:

  • Readable font sizes: Minimum 16px for body text
  • Sufficient line height: At least 1.5 for body text
  • Clear hierarchy: Distinct size differences between levels
  • High contrast: Proper color combinations
  • Font loading: Web font fallbacks included

Font Loading Strategy

// Fonts load with fallbacks
fonts: {
body: '"Atkinson Hyperlegible", Arial, sans-serif',
heading: '"Work Sans", Helvetica, sans-serif',
mono: '"Inconsolata", "Courier New", monospace'
}

Responsive Typography

Typography scales appropriately across breakpoints:

// Responsive font sizes
<Heading
sx={{
fontSize: ['2xl', '3xl', '4xl'], // Mobile, tablet, desktop
lineHeight: ['sm', 'base', 'lg'],
}}
>
Responsive heading
</Heading>

Multi-Theme Typography

Different themes can use different font families while maintaining the same structure:

// Bruttal Theme
fonts: {
body: '"Atkinson Hyperlegible", sans-serif',
heading: '"Work Sans", sans-serif'
}

// Oca Theme
fonts: {
body: '"Source Sans Pro", sans-serif',
heading: '"Outfit", sans-serif'
}