Maison & Atelier
Refined contrast and graceful proportion lend a quiet luxury to fashion, beauty, and premium editorial work.
Frontend Encyclopedia
Everything that makes interfaces look good, in one place — color, type, scale, spacing, design principles, and visual hierarchy. Not just the materials, but the why. The visual system of the front end, on a single page.
Foundations · System Layer
Good color isn't guesswork — it rests on hue, saturation, and lightness, plus a set of derivable harmony relationships. Learn the principles, take the tools.
Every color decomposes into hue (which color), saturation (how vivid), and lightness (how bright). Drag to feel each axis.
From the base color above, fixed angles on the wheel yield harmonious palettes. Click any to copy CSS variables.
Text-to-background contrast drives readability. WCAG wants at least 4.5:1 (AA) for body text, 7:1 (AAA) ideal.
Readability preview Aa
Passes — safe for text.
Beyond principles, a few rules of thumb make any palette look intentional.
60% dominant, 30% secondary, 10% accent — balanced with a focal point.
Warm hues advance and energize; cool hues recede and calm.
Users carry fixed expectations for these — don't fight them.
Curated Type Directions
A tightly edited collection of open-source font pairings for real interface styles. Compare letterforms, understand where each pairing belongs, then copy production-ready CSS or Tailwind tokens.
Showing 41 pairings
Refined contrast and graceful proportion lend a quiet luxury to fashion, beauty, and premium editorial work.
Considered typography that endures. Every letterform carries tradition while remaining comfortable for long-form reading.
Considered typography that endures. Every letterform carries tradition while remaining comfortable for long-form reading.
Clean lines and confident spacing shape interfaces that feel effortless, fast, and unmistakably current.
Clean lines and confident spacing shape interfaces that feel effortless, fast, and unmistakably current.
Bright, friendly type for products that keep the experience light without becoming childish.
Long-form reading deserves rhythm and contrast. A serif headline sets the tone; the body face carries the story.
Long-form reading deserves rhythm and contrast. A serif headline sets the tone; the body face carries the story.
Monospace precision meets readable prose for documentation, dashboards, and dependable technical interfaces.
Monospace precision meets readable prose for documentation, dashboards, and dependable technical interfaces.
Clean lines and confident spacing shape interfaces that feel effortless, fast, and unmistakably current.
Clean lines and confident spacing shape interfaces that feel effortless, fast, and unmistakably current.
Monospace precision meets readable prose for documentation, dashboards, and dependable technical interfaces.
Considered typography that endures. Every letterform carries tradition while remaining comfortable for long-form reading.
Long-form reading deserves rhythm and contrast. A serif headline sets the tone; the body face carries the story.
Considered typography that endures. Every letterform carries tradition while remaining comfortable for long-form reading.
Clean lines and confident spacing shape interfaces that feel effortless, fast, and unmistakably current.
Bright, friendly type for products that keep the experience light without becoming childish.
Monospace precision meets readable prose for documentation, dashboards, and dependable technical interfaces.
Monospace precision meets readable prose for documentation, dashboards, and dependable technical interfaces.
Bright, friendly type for products that keep the experience light without becoming childish.
Bright, friendly type for products that keep the experience light without becoming childish.
Refined contrast and graceful proportion lend a quiet luxury to fashion, beauty, and premium editorial work.
Refined contrast and graceful proportion lend a quiet luxury to fashion, beauty, and premium editorial work.
Refined contrast and graceful proportion lend a quiet luxury to fashion, beauty, and premium editorial work.
Monospace precision meets readable prose for documentation, dashboards, and dependable technical interfaces.
Clean lines and confident spacing shape interfaces that feel effortless, fast, and unmistakably current.
System layer · Typography
Font sizes should not be guesswork. A modular scale derives every step from one base by a fixed ratio, giving the whole system a single mathematical relationship — then clamp() makes it scale fluidly with the viewport, no breakpoints.
With base 16px and ratio 1.25 (Major Third), each step is 1.25× the previous. Use 16px as the base (not 14/15px) — it is the browser's default body size.
Standard — most products (Stripe/Material)
:root {
--text-xs: 0.64rem; /* 10.24px */
--text-sm: 0.8rem; /* 12.8px */
--text-base: 1rem; /* 16px */
--text-lg: 1.25rem; /* 20px */
--text-xl: 1.5625rem; /* 25px */
--text-2xl: 1.9531rem; /* 31.25px */
--text-3xl: 2.4414rem; /* 39.06px */
--text-4xl: 3.0518rem; /* 48.83px */
--text-5xl: 3.8147rem; /* 61.04px */
}@theme {
--text-xs: 0.64rem;
--text-sm: 0.8rem;
--text-base: 1rem;
--text-lg: 1.25rem;
--text-xl: 1.5625rem;
--text-2xl: 1.9531rem;
--text-3xl: 2.4414rem;
--text-4xl: 3.0518rem;
--text-5xl: 3.8147rem;
}| Ratio | Best for |
|---|---|
| 1.125–1.2 | Dense UI, dashboards, data tables |
| 1.25–1.333 | Most products, SaaS, docs |
| 1.414–1.618 | Editorial, marketing, display-led |
System layer · Layout
Spacing is the rhythm of a layout. Snap every padding, margin, and gap to one 8-pixel grid and the page breathes as a system — instead of a pile of arbitrary 13px and 17px values.
Every value is a multiple of 8 (with 4px as a fine half-step). Why 8? The common screen densities — 1x, 1.5x, 2x, 3x — all divide 8 into whole pixels, so 8px padding renders pixel-perfect on phone, desktop, and retina alike, while 5px or 7px go soft from sub-pixel rounding.
The rule: snap to the scale or extend the scale — never invent 13px in place.
12 columns · 32px gutter · 24px margin. 12 divides into 2/3/4/6 — halves, thirds, quarters, sixths all align.
:root {
--space-0: 0rem; /* 0px */
--space-xs: 0.25rem; /* 4px */
--space-sm: 0.5rem; /* 8px */
--space-md: 1rem; /* 16px */
--space-lg: 1.5rem; /* 24px */
--space-xl: 2rem; /* 32px */
--space-2xl: 3rem; /* 48px */
--space-3xl: 4rem; /* 64px */
--space-4xl: 6rem; /* 96px */
--space-5xl: 8rem; /* 128px */
}@theme {
--spacing-0: 0rem;
--spacing-xs: 0.25rem;
--spacing-sm: 0.5rem;
--spacing-md: 1rem;
--spacing-lg: 1.5rem;
--spacing-xl: 2rem;
--spacing-2xl: 3rem;
--spacing-3xl: 4rem;
--spacing-4xl: 6rem;
--spacing-5xl: 8rem;
}System layer · Principles
Color, type, scale, and spacing give you correct elements; CRAP tells you how to organize them. Contrast, Repetition, Alignment, Proximity — four principles that turn a pile of correct tokens into a layout that reads as intentional.
If two elements are not the same, make them clearly different — never almost the same. Contrast creates hierarchy and pulls the eye to what matters.
Don't be timid — if elements differ, make them differ boldly.
Repeat visual elements — color, shape, type, spacing — throughout the design. Repetition builds unity and makes a layout feel like one system instead of scattered parts.
Reuse the same tokens everywhere — consistency reads as intention.
Every element should have a visual connection to something else on the page. Nothing is placed arbitrarily — shared edges and baselines create an invisible order the eye trusts.
Nothing floats — put everything on a shared edge or baseline.
Group related items close together and push unrelated ones apart. Proximity turns scattered elements into a few clear units, cutting the work the reader's eye has to do.
Closeness equals relationship — group by meaning, not by gut.
Flip the switch and watch the same content go from arbitrary to principled — the gap is visible at a glance.
One typographic hierarchy beats ten captions.
Product name
A short one-line description
Try it now
.title {
font-size: 2.5rem;
font-weight: 700;
}
.body {
font-size: 1rem;
font-weight: 400;
color: var(--muted);
}:root {
--radius: 8px;
--shadow: 0 1px 3px rgb(0 0 0 / 0.1);
}
.card {
border-radius: var(--radius);
box-shadow: var(--shadow);
}.form {
display: grid;
gap: 12px;
}
.form > * {
text-align: left;
}.field {
display: flex;
flex-direction: column;
gap: 4px;
}
.form {
display: flex;
flex-direction: column;
gap: 24px;
}System layer · Attention
Visual hierarchy is control over the order the eye moves through a layout. Four levers — size, weight, color, and space — set each element's visual weight, and that weight decides where attention flows first.
Bigger elements are seen first — size is the loudest signal in the room.
Heavier strokes carry more visual mass and hold the eye longer.
High contrast against the background jumps forward; muted tones recede.
Whitespace and isolation give an element room to command attention.
Toggle the levers — the numbers on the left are the scan order, ranked live by visual weight. Switch them all off and everything goes flat, read top to bottom; switch them on and a clear order emerges.
Freeze the hierarchy into three text tokens — primary, secondary, tertiary — separated by relative size, weight, and opacity instead of tuning each one by hand.
.text-primary {
font-size: 1.5rem;
font-weight: 700;
opacity: 1;
}
.text-secondary {
font-size: 1rem;
font-weight: 500;
opacity: 0.9;
}
.text-tertiary {
font-size: 0.875rem;
font-weight: 400;
opacity: 0.6;
}