Typography
The ln type system is built on a 24px vertical rhythm grid. Every font size, line height, and spacing value is a whole multiple of 8px, and heading line heights are whole multiples of 24px.
Available classes
These classes let you apply typographic styles to any element, regardless of its tag.
Lead text
Use .lead on introductory paragraphs that need more visual weight than body text. It sets the prose font at lead size.
<p class="lead">Introductory sentence in prose font, slightly larger than body.</p>Introductory sentence in prose font, slightly larger than body.
Paragraphs
Body paragraphs use the UI font at 1rem / 1.5rem (16px / 24px). The base layer adds a bottom margin of one line (24px) so paragraphs stack with consistent rhythm.
<p class="mb-3">The ln type system is built on a 24px vertical rhythm grid. Every font size, line height, and spacing value is a whole multiple of 8px.</p>
<p class="mb-3">Paragraphs receive their styles from the base layer automatically. No utility classes are needed for standard prose content.</p>
<p>The bottom margin on the last paragraph is removed to prevent unwanted trailing space inside containers.</p>The ln type system is built on a 24px vertical rhythm grid. Every font size, line height, and spacing value is a whole multiple of 8px.
Paragraphs receive their styles from the base layer automatically. No utility classes are needed for standard prose content.
The bottom margin on the last paragraph is removed to prevent unwanted trailing space inside containers.
Headings
Heading elements h1–h6 receive size, line height, and font-family styles from the base layer. No classes needed.
<h1 class="mb-3">Heading level one</h1>
<h2 class="mb-3">Heading level two</h2>
<h3 class="mb-3">Heading level three</h3>
<h4 class="mb-3">Heading level four</h4>
<h5 class="mb-3">Heading level five</h5>
<h6>Heading level six</h6>Heading level one
Heading level two
Heading level three
Heading level four
Heading level five
Heading level six
Heading style classes
Apply heading visual styles to any element. Unlike the heading elements themselves, these classes carry no margin — useful when you need the appearance of a heading on a div, span, or any other tag. Use .h1 through .h6.
<div class="h1 mb-3">Heading one style on a div</div>
<div class="h2 mb-3">Heading two style on a div</div>
<div class="h3 mb-3">Heading three style on a div</div>
<div class="h4 mb-3">Heading four style on a div</div>
<div class="h5 mb-3">Heading five style on a div</div>
<div class="h6">Heading six style on a div</div>Display sizes
Large display sizes for hero headings and marketing copy. Both use the prose font. Use .text-display-1 and .text-display-2.
<h1 class="text-display-1 mb-3">Hero heading</h1>
<h2 class="text-display-2">Section hero</h2>Hero heading
Section hero
Responsive
Heading style classes and display sizes support responsive breakpoint suffixes: @sm, @md, @lg, @xl, @2xl.
<div class="h4 h2@md mb-3">h4 on mobile, h2 from md up</div>
<div class="text-display-2 text-display-1@lg">Display 2 on mobile, display 1 from lg up</div>Base element defaults
Heading elements h1–h6, paragraphs, blockquotes, lists, and other block elements receive base styles automatically from @layer base. No class names needed for standard prose content.
<article>
<h1>Title</h1>
<p class="lead">Lead paragraph.</p>
<p>Body copy — no extra classes needed.</p>
<h2>Section</h2>
<blockquote><p>A quote.</p></blockquote>
<ul><li>List item</li></ul>
<pre><code>code block</code></pre>
</article>Typographic defaults
Every element below is unstyled HTML — no utility classes, no overrides. The base layer handles spacing, scale, and rhythm automatically.
The ln type system is built on two grids: an 8px base grid for spacing and an 24px line grid for vertical rhythm. Font sizes, line heights, and margins are all whole multiples of these values, so elements snap to the grid without manual adjustment.
Rhythm and spacing
Headings carry top and bottom margins derived from the line grid. Paragraphs have a bottom margin of one line (24px). The result is a consistent vertical cadence across the page regardless of which elements appear in sequence.
The reader should be able to move through the text without being aware of the typography. — Robert Bringhurst
Inline elements
Inline styles are set once in the base layer and apply everywhere. Bold and italic text, inline code, hyperlinks, abbr, highlighted text, deleted, and inserted content all receive appropriate styles without any class names.
Lists
- Unordered lists use the primary colour for list markers
- Line height matches the body grid step — 24px
- Indent is set to
--s4(2rem)
- Ordered lists use tabular numerals
- Same spacing and indent as unordered
- No extra classes required
Reference table
| Token | Value | Role |
|---|---|---|
--t-body-s | 1rem | Body copy |
--t-lead-s | 1.125rem | Lead paragraph |
--t-h1-s | 2.5rem | Page title |
Code blocks
Preformatted code inherits the mono font stack, gets a sunken surface background, and scrolls horizontally on overflow.
@use 'ln/scss' with (
$prefix: 'my-',
$g: 4px
);Type scale tokens
All type sizes are exposed as CSS custom properties on :root. Reference them in your own stylesheets to stay on-grid without importing the full library.
/* reference any scale token in your own CSS */
.my-heading {
font-size: var(--t-h2-s);
line-height: var(--t-h2-lh);
}| Token | Font | Size | Line height | Sample |
|---|---|---|---|---|
--t-display-1 | prose | 80px | 96px | The quick brown fox |
--t-display-2 | prose | 56px | 72px | The quick brown fox |
--t-h1 | prose | 40px | 48px | Section heading |
--t-h2 | prose | 32px | 48px | Section heading |
--t-h3 | prose | 20px | 24px | Section heading |
--t-h4 | ui | 18px | 24px | Section heading |
--t-h5 | ui | 16px | 24px | Section heading |
--t-h6 | mono | 12px | 16px | SECTION LABEL |
--t-lead | prose | 18px | 24px | The five boxing wizards jump quickly. |
--t-body-prose | prose | 16px | 24px | The five boxing wizards jump quickly. |
--t-body-lg | ui | 18px | 24px | The five boxing wizards jump quickly. |
--t-body | ui | 16px | 24px | The five boxing wizards jump quickly. |
--t-body-sm | ui | 14px | 20px | The five boxing wizards jump quickly. |
--t-body-xs | ui | 12px | 16px | The five boxing wizards jump quickly. |
--t-meta | ui | 12px | 16px | SKU: 123456-A |
--t-code | mono | 14px | 24px | const x = fn(42); |
On smaller viewports (below md), h1 scales down to 2.25rem / 3rem to preserve rhythm on narrow screens.
Font role tokens
Three font-family tokens map to semantic roles. Override them at :root to swap the entire type stack, or on a scoped element to change a single section.
/* override globally */
:root {
--f-prose: 'Georgia', serif;
--f-ui: 'Inter', sans-serif;
--f-mono: 'Fira Code', monospace;
}
/* or scope to a single section */
.my-section {
--f-prose: var(--f-ui);
}--f-prose- Charter, Bitstream Charter, Sitka Text, Cambria, serif — used for headings h1–h3, blockquotes, and lead text.
--f-ui- Inter, Roboto, Helvetica Neue, Arial Nova, sans-serif — used for body text, labels, and UI elements.
--f-mono- ui-monospace, Cascadia Code, Source Code Pro, Menlo, Consolas — used for code, kbd, and h6.
Reference
| Class | Description | Responsive |
|---|---|---|
.lead | Lead paragraph (prose font, larger size) | No |
.h1–.h6 | Heading visual styles without margin | Yes |
.text-display-1 | Display size 1 (hero headings) | Yes |
.text-display-2 | Display size 2 (section heroes) | Yes |