Vanilla Breeze

Typography

How Vanilla Breeze handles typographic refinement: font synthesis control, context-sensitive emphasis, sub/sup positioning, prose hyphenation, drop caps, heading tracking, and character tokens.

Philosophy

VB uses progressive CSS enhancement for typography. Every feature in this guide is additive: browsers that don't support a property simply ignore it and fall back to the base style. No JavaScript is required.

Font Synthesis Control

When a font family lacks a true bold or italic variant, browsers synthesize (fake) one by algorithmically thickening or slanting glyphs. This often looks poor. VB sets font-synthesis: none on <strong>, <b>, <em>, and <i> to prevent faux bold/italic rendering.

font-optical-sizing: auto lets OpenType variable fonts adjust stroke weight and contrast based on the rendered size, producing crisper text at small sizes and better proportions at display sizes.

Combined Bold-Italic

When <b> and <i> are nested (in either order), VB applies both weight and style with synthesis control:

Context-Sensitive Emphasis

Bold and italic render differently depending on their surrounding context:

Bold in Code

Inside <code> and <pre>, bold text gets a subtle highlight background instead of relying solely on weight. This is more visible in monospace fonts where weight differences are subtle.

Italic in Blockquote

Inside blockquotes, italic text is de-emphasized: it renders as normal style with medium weight. Since blockquotes are already visually offset, additional italic can feel overwrought.

Subscript and Superscript

VB uses font-variant-position for sub/sup when the browser supports it. This produces properly designed glyphs from the font's glyph table rather than shrunk-and-shifted text. The fallback uses the traditional font-size + position: relative approach.

Headings

All headings (h1h6) receive two typographic enhancements:

  • font-variant-numeric: lining-nums — Ensures numbers in headings align with capital letters rather than descending like oldstyle numerals
  • hyphens: none — Prevents headings from being hyphenated (hyphenation is for body text, not display text)

Additionally, h1 and h2 get tighter letter-spacing (tracking) to improve their visual density at large sizes:

ElementLetter Spacing
h1-0.025em (var(--letter-spacing-tight))
h2-0.01em
h3h6Normal (inherited)

Drop Caps

Use data-drop-cap on an <article> or individual <p> to enlarge the first letter. VB uses the CSS initial-letter property when supported (Safari, Chrome 110+), falling back to float + font-size in other browsers.

Prose Hyphenation

Blog-style articles (article.blog) and prose articles (article[data-prose]) get automatic hyphenation. This requires the lang attribute on <html> so the browser knows which language's hyphenation dictionary to use.

PropertyValuePurpose
hyphensautoEnable automatic hyphenation
hyphenate-limit-chars6 3 2Min 6 chars, at least 3 before and 2 after break
hyphenate-limit-lines2No more than 2 consecutive hyphenated lines
hyphenate-limit-zone8%Only hyphenate in rightmost 8% of line

Note: Hyphenation only works when <html lang="..."> is set. Without it, the browser has no dictionary to consult.

Character Tokens

VB provides CSS custom properties for commonly needed typographic characters. Use them in content properties or anywhere CSS accepts string values. Themes can override these tokens to change separators globally.

Separators

TokenCharacterDescription
--sep-breadcrumbSingle right-pointing angle (breadcrumb default)
--sep-list·Middle dot (inline list separator)
--sep-pipe|Vertical bar
--sep-mdashEm dash
--sep-ndashEn dash
--sep-section§Section sign
--sep-paraPilcrow / paragraph sign

List Markers

TokenCharacterDescription
--marker-defaultBullet
--marker-checkCheck mark
--marker-arrowRight-pointing arrow
--marker-dashHyphen bullet

Math and Keyboard

TokenCharacterDescription
--char-times×Multiplication sign
--char-minusTrue minus sign
--char-degree°Degree symbol
--key-cmdCommand (Mac)
--key-optionOption (Mac)
--key-shiftShift
--key-ctrlControl
--key-returnReturn / Enter

Baseline Unit (--lh)

The --lh token equals 1.5rem (one body line-height). Use it for vertical rhythm in prose contexts where spacing should align to the text baseline grid:

Blockquote Hanging Punctuation

Blockquotes apply hanging-punctuation: first last so that opening and closing quotation marks hang into the margin. This is a progressive enhancement supported in Safari.

Status Indicator

An inline status dot for dashboards, deploy statuses, and similar UI. Uses the .status class with data-status.

data-statusIconColor
success● filled circle--color-success
warning● filled circle--color-warning
error● filled circle--color-error
inactive○ empty circle--color-text-muted
check✔ check mark--color-success
fail✘ cross mark--color-error

Metadata List

An inline list of items separated by middle dots. Use ul.meta for article metadata, tag lists, or similar horizontal data.

List Marker Variants

Override default bullet markers with data-marker on a <ul>.

Section Numbering

Use data-section-numbers on an <article> for §-style legal/document numbering. Each h2 gets a section number; h3 headings get alphabetic sub-numbers.

This is distinct from data-numbered (outline-style 1.1, 1.2 numbering).

Block Progress

A Unicode block-character progress bar for terminal-style UI. Uses role="meter" for accessibility.

Print URL Expansion

When printing, VB automatically expands external, email, and phone link URLs after the link text so readers can see the destination. This is suppressed for image links and same-page anchors.

Related

  • Design Tokens — Full token reference including font sizes, line heights, and measure
  • i18n — Locale-aware quotes, script-specific typography
  • Anchor element — Link auto-indicators for mailto, tel, PDF
  • Fluid Scaling — Responsive typography with clamp()
  • hgroup — Heading group patterns (eyebrow, byline, display, section-header)