Skip to content

Typography

Empathy DS uses the system font stack for optimal performance and native feel across platforms.

Font Stack

css
font-family: ui-sans-serif, system-ui, sans-serif, "Apple Color Emoji", "Segoe UI Emoji", "Segoe UI Symbol", "Noto Color Emoji";

This stack ensures:

  • Apple devices: San Francisco
  • Windows: Segoe UI
  • Android: Roboto
  • Linux: Liberation Sans or similar

Text Sizes

Use Tailwind's text utilities based on a consistent scale:

ClassSizeLine HeightUsage
text-xs0.75rem (12px)1remLabels, captions
text-sm0.875rem (14px)1.25remSecondary text, small UI
text-base1rem (16px)1.5remBody text (default)
text-lg1.125rem (18px)1.75remLead paragraphs
text-xl1.25rem (20px)1.75remSmall headings
text-2xl1.5rem (24px)2remSection headings
text-3xl1.875rem (30px)2.25remPage titles
text-4xl2.25rem (36px)2.5remHero text

Font Weights

ClassWeightUsage
font-normal400Body text
font-medium500Emphasis, buttons
font-semibold600Headings, labels
font-bold700Strong emphasis

Usage Examples

Headings

vue
<template>
  <h1 class="text-3xl font-bold tracking-tight">Page Title</h1>
  <h2 class="text-2xl font-semibold">Section Heading</h2>
  <h3 class="text-xl font-semibold">Subsection</h3>
</template>

Body Text

vue
<template>
  <p class="text-base text-foreground">
    Primary body text uses the default size and foreground color.
  </p>
  
  <p class="text-sm text-muted-foreground">
    Secondary or supporting text uses smaller size and muted color.
  </p>
</template>

Labels and Captions

vue
<template>
  <label class="text-sm font-medium">Input Label</label>
  <p class="text-xs text-muted-foreground">Helper text or caption</p>
</template>

Component Typography

Components have built-in typography that follows these conventions:

ComponentText Classes
Buttontext-sm font-medium
Labeltext-sm font-medium
CardTitletext-2xl font-semibold
CardDescriptiontext-sm text-muted-foreground
DialogTitletext-lg font-semibold
DialogDescriptiontext-sm text-muted-foreground
AlertTitlefont-medium
AlertDescriptiontext-sm

Letter Spacing

ClassValueUsage
tracking-tight-0.025emLarge headings
tracking-normal0Body text (default)
tracking-wide0.025emAll caps, labels
vue
<template>
  <h1 class="text-4xl font-bold tracking-tight">Hero Title</h1>
  <span class="text-xs font-medium tracking-wide uppercase">Label</span>
</template>

Best Practices

  1. Use semantic color tokens for text:

    • text-foreground for primary text
    • text-muted-foreground for secondary text
    • text-destructive for error messages
  2. Maintain hierarchy with consistent size jumps

  3. Don't skip heading levels (h1 → h2 → h3)

  4. Use font-medium for interactive elements (buttons, links)

  5. Keep line lengths readable (50-75 characters for body text)

vue
<template>
  <div class="max-w-prose">
    <p>This paragraph will have a comfortable reading width...</p>
  </div>
</template>