Frontile's typography system is a scalable type system built on semantic text styles and a modular scale. It uses Tailwind v4's @theme directive for base tokens and @layer utilities for explicit utility classes.
Overview
The typography system includes:
7 text style categories: Marquee, Header, Strong, Body, Code, Caption, and Label
Multiple size variants for each category
Modular scale based on a mathematical ratio for harmonic sizing
Composite utility classes that bundle all typography properties together
Full customization through CSS variables
Text Style Categories
Marquee
Large, semibold serif display text (Domine) for hero sections and prominent headings.
Emphasis text for numerics, prices, and metrics. Shares the Header size, tracking, and leading scale but is a distinct role so it can be styled independently.
Available sizes:4xs, 3xs, 2xs, xs, sm, md, lg, xl, 2xl, 3xlFont: Open Sans · Weight: bold · Best for: Prices, counts, metrics, any numeric emphasis
Body
Standard body text with spacious line height optimized for readability.
Body 3XL: The quick brown fox jumps over the lazy dog. This is 3XL body text with spacious line height for comfortable reading.
Body 2XL: The quick brown fox jumps over the lazy dog. This is 2XL body text with spacious line height for comfortable reading.
Body XL: The quick brown fox jumps over the lazy dog. This is extra large body text with spacious line height for comfortable reading.
Body LG: The quick brown fox jumps over the lazy dog. This is large body text with spacious line height for comfortable reading.
Body MD: The quick brown fox jumps over the lazy dog. This is default body text with spacious line height for comfortable reading.
Body SM: The quick brown fox jumps over the lazy dog. This is small body text with spacious line height for comfortable reading.
Body XS: The quick brown fox jumps over the lazy dog. This is extra small body text.
Body 2XS: The quick brown fox jumps over the lazy dog. This is 2XS body text.
Body 3XS: The quick brown fox jumps over the lazy dog. This is 3XS body text.
Body 4XS: The quick brown fox jumps over the lazy dog. This is 4XS body text.
Body 5XS: The quick brown fox jumps over the lazy dog. This is 5XS body text.
<template> <div class='flex flex-col gap-6'> <p class='font-body text-body-3xl'> Body 3XL: The quick brown fox jumps over the lazy dog. This is 3XL body text with spacious line height for comfortable reading. </p> <p class='font-body text-body-2xl'> Body 2XL: The quick brown fox jumps over the lazy dog. This is 2XL body text with spacious line height for comfortable reading. </p> <p class='font-body text-body-xl'> Body XL: The quick brown fox jumps over the lazy dog. This is extra large body text with spacious line height for comfortable reading. </p> <p class='font-body text-body-lg'> Body LG: The quick brown fox jumps over the lazy dog. This is large body text with spacious line height for comfortable reading. </p> <p class='font-body text-body-md'> Body MD: The quick brown fox jumps over the lazy dog. This is default body text with spacious line height for comfortable reading. </p> <p class='font-body text-body-sm'> Body SM: The quick brown fox jumps over the lazy dog. This is small body text with spacious line height for comfortable reading. </p> <p class='font-body text-body-xs'> Body XS: The quick brown fox jumps over the lazy dog. This is extra small body text. </p> <p class='font-body text-body-2xs'> Body 2XS: The quick brown fox jumps over the lazy dog. This is 2XS body text. </p> <p class='font-body text-body-3xs'> Body 3XS: The quick brown fox jumps over the lazy dog. This is 3XS body text. </p> <p class='font-body text-body-4xs'> Body 4XS: The quick brown fox jumps over the lazy dog. This is 4XS body text. </p> <p class='font-body text-body-5xs'> Body 5XS: The quick brown fox jumps over the lazy dog. This is 5XS body text. </p> </div></template>
Available sizes:5xs, 4xs, 3xs, 2xs, xs, sm, md, lg, xl, 2xl, 3xlBest for: Paragraphs, article content, descriptions, general text
Code
Monospace text for code snippets and technical content.
Available sizes:sm, mdBest for: Code blocks, inline code, technical identifiers
Caption
Secondary descriptive text with relaxed letter spacing.
Example Image
Caption MD: Figure 1 - Example image caption with medium size
Caption SM: Small caption text for supplementary information
<template> <div class='flex flex-col gap-3'> <div> <div class='bg-neutral-subtle rounded mb-2 h-32 flex items-center justify-center text-neutral-strong'> Example Image </div> <span class='font-caption text-caption-md text-neutral-strong'>Caption MD: Figure 1 - Example image caption with medium size</span> </div> <div> <span class='font-caption text-caption-sm text-neutral-strong'>Caption SM: Small caption text for supplementary information</span> </div> </div></template>
Available sizes:sm, mdBest for: Image captions, figure labels, supplementary text
Label
UI labels and form labels with semibold weight and tight (100%) leading.
Label 3XL: Extra Large Label
Label 2XL: Double Extra Large Label
Label XL: Extra Large Label
Label LG: Large Label
Label MD: Medium Label
Label SM: Small Label
Label XS: Extra Small Label
Label 2XS: Double Extra Small Label
Label Micro: Micro Label
Label Nano: Nano Label
<template> <div class='flex flex-col gap-3'> <div class='font-label text-label-3xl'>Label 3XL: Extra Large Label</div> <div class='font-label text-label-2xl'>Label 2XL: Double Extra Large Label</div> <div class='font-label text-label-xl'>Label XL: Extra Large Label</div> <div class='font-label text-label-lg'>Label LG: Large Label</div> <div class='font-label text-label-md'>Label MD: Medium Label</div> <div class='font-label text-label-sm'>Label SM: Small Label</div> <div class='font-label text-label-xs'>Label XS: Extra Small Label</div> <div class='font-label text-label-2xs'>Label 2XS: Double Extra Small Label</div> <div class='font-label text-label-micro'>Label Micro: Micro Label</div> <div class='font-label text-label-nano'>Label Nano: Nano Label</div> </div></template>
Available sizes:nano, micro, 2xs, xs, sm, md, lg, xl, 2xl, 3xlBest for: Form labels, UI labels, buttons, navigation items, badges
Available Utilities
All text style utilities require both a font-family utility and a sized text style utility:
<!-- Complete typography requires both font-family and sized text style --><h1 class="font-marquee text-marquee-xl">...</h1><h2 class="font-header text-header-md">...</h2><p class="font-body text-body-md">...</p><code class="font-code text-code-sm">...</code><span class="font-caption text-caption-md">...</span><label class="font-label text-label-sm">...</label>
Combining with Other Utilities
Typography utilities work with other Tailwind utilities:
Colored Header
This is a very long paragraph that will be truncated with an ellipsis when it exceeds the maximum width.
Centered caption text
Responsive Heading
<template> <div class='flex flex-col gap-4'> {{! Colored header }} <h2 class='font-header text-header-xl text-primary-strong'>Colored Header</h2> {{! Truncated body text }} <p class='font-body text-body-md truncate max-w-md'> This is a very long paragraph that will be truncated with an ellipsis when it exceeds the maximum width. </p> {{! Centered caption }} <span class='font-caption text-caption-md text-center block text-neutral-strong'> Centered caption text </span> {{! Responsive header }} <h1 class='font-header text-header-lg md:text-header-xl lg:text-header-2xl'> Responsive Heading </h1> </div></template>
How It Works
The typography system uses Tailwind v4's @theme directive to automatically generate utilities from CSS variables:
Base tokens defined in @theme automatically generate individual utilities:
--font-header → font-header utility
--font-size-14 → text-14 utility
--font-weight-bold → font-bold utility
--letter-spacing-tight → tracking-tight utility
--font-weight-semibold → font-semibold utility
Composite text style tokens generate size/weight/spacing utilities (but NOT font-family):
Usage pattern: Combine font-family with text style for complete typography:
<!-- ✓ Correct: Combine font-family with text style --><h2 class="font-header text-header-md">Heading Text</h2><p class="font-body text-body-lg">Body text with larger size</p><span class="font-label text-label-sm">Small label</span><!-- ✗ Incomplete: Missing font-family --><h2 class="text-header-md">Heading Text</h2>
The separation of font-family from text styles provides flexibility to mix font families with different text styles while maintaining consistent sizing, weight, spacing, and line-height.
Customization
Using CSS Variables
Customize typography by overriding CSS variables in your app's CSS file:
Use size variants to create clear content hierarchy:
Article Title
Published on December 7, 2024
Major Section
This is the main body content with comfortable line height for easy reading. The text flows naturally and maintains good readability.
Subsection
Subsection content continues the hierarchy with appropriately sized headers.
Figure 1: Caption providing additional context
<template> <article class='space-y-4'> <h1 class='font-header text-header-3xl text-neutral-strong'>Article Title</h1> <p class='font-body text-body-md text-neutral-strong'>Published on December 7, 2024</p> <div class='space-y-3'> <h2 class='font-header text-header-xl text-neutral-strong'>Major Section</h2> <p class='font-body text-body-md text-neutral-firm'> This is the main body content with comfortable line height for easy reading. The text flows naturally and maintains good readability. </p> <h3 class='font-header text-header-lg text-neutral-strong'>Subsection</h3> <p class='font-body text-body-md text-neutral-firm'> Subsection content continues the hierarchy with appropriately sized headers. </p> <span class='font-caption text-caption-sm text-neutral-strong block'> Figure 1: Caption providing additional context </span> </div> </article></template>
Responsive Typography
Scale typography for different screen sizes:
Responsive Heading
Body text that scales up on larger screens for better readability across all devices.
<template> <div class='space-y-4'> <h1 class='font-header text-header-lg md:text-header-xl lg:text-header-2xl text-neutral-strong'> Responsive Heading </h1> <p class='font-body text-body-sm md:text-body-md lg:text-body-lg text-neutral-firm'> Body text that scales up on larger screens for better readability across all devices. </p> </div></template>