Typography snippets

CSS typography snippets: fluid type, text truncation, and font styling. Every snippet includes a live demo, copyable CSS, and an LLM-ready prompt.

Widely supported

Anchor link with scroll-margin

Anchor link with scroll-margin snippet with a live demo, copyable CSS, and implementation prompt.

no-js
Widely supported

Animated heading entrance

Animate heading text entrances with CSS keyframes for fade-up, split-letter, and clip-path reveal effects.

animationno-js
Widely supported

Breadcrumb link

Breadcrumb link snippet with a live demo, copyable CSS, and implementation prompt.

no-js
Widely supported

Clamp heading system

Clamp heading system snippet with a live demo, copyable CSS, and implementation prompt.

no-js
Widely supported

Code block with header

Styled code block with language label header, line numbers area, and copy button positioning. Dark theme, monospace font.

no-js
Widely supported

Condensed heading

Condensed heading snippet with a live demo, copyable CSS, and implementation prompt.

no-js
Widely supported

Copy button on code block

Position a copy-to-clipboard button on code blocks using CSS positioning and oklch() styled controls.

uino-js
Widely supported

Custom list markers

Custom list markers snippet with a live demo, copyable CSS, and implementation prompt.

no-js
Widely supported

Dark mode body text

Optimized body text settings for dark mode — reduced font-weight, increased letter-spacing, and tuned oklch lightness for comfortable reading. Copy and go.

colorno-js
Widely supported

Diff display (green/red)

A CSS diff display with green added lines and red removed lines using oklch() background colors. No JavaScript, no library.

colorno-js
Widely supported

Display/hero heading

Display/hero heading snippet with a live demo, copyable CSS, and implementation prompt.

no-js
Widely supported

External link icon

External link icon snippet with a live demo, copyable CSS, and implementation prompt.

no-js
Widely supported

Filename header

Add a filename header to code blocks with a tab-like label and copy button. Perfect for docs, snippets, and multi-file examples.

uino-js
Widely supported

First-line indent

CSS text-indent for book-style paragraph indentation. First paragraph flush, subsequent paragraphs indented — no margins between. Copy and go.

no-js
Widely supported

Fluid body text

Fluid font sizing using clamp() for body text that scales smoothly between viewport sizes. No breakpoints, no JavaScript.

no-js
Widely supported

Fluid heading with clamp()

Create fluid responsive headings using CSS clamp() that scale smoothly between minimum and maximum sizes.

no-js
Widely supported

Fluid Typography

Smoothly scale font size between a minimum and maximum with clamp() — no breakpoints, no media queries.

no-js
Widely supported

Gradient text heading

Create vibrant gradient text headings using background-clip: text and oklch() linear gradients.

colorno-js
Widely supported

Gradient underline

Gradient underline snippet with a live demo, copyable CSS, and implementation prompt.

no-js
Widely supported

Heading + badge

Heading + badge snippet with a live demo, copyable CSS, and implementation prompt.

no-js
Widely supported

Heading + decorative rule

Add decorative lines and rules to headings using CSS pseudo-elements, borders, and oklch() accent colors.

no-js
Widely supported

Heading + icon

Heading + icon snippet with a live demo, copyable CSS, and implementation prompt.

no-js
Widely supported

Heading + subtitle pair

Style heading and subtitle pairs with consistent spacing, hierarchy, and visual balance using CSS.

no-js
Widely supported

High-contrast body text

Use prefers-contrast: more to serve higher-contrast body text with adjusted letter-spacing and line-height. Accessible CSS. Copy and go.

a11yno-js
Widely supported

Highlight specific line

Highlight a specific line in a code block using CSS only. Works for docs and tutorials—use data-line attributes and layered backgrounds.

uino-js
Widely supported

Hover color transition

Hover color transition snippet with a live demo, copyable CSS, and implementation prompt.

no-js
Widely supported

Hyphenated text

Automatic hyphenation with CSS hyphens property for justified and narrow-column text. Better word breaks without manual soft hyphens.

no-js
Widely supported

Icon list markers

Icon list markers snippet with a live demo, copyable CSS, and implementation prompt.

no-js
Widely supported

Inline code style

Styled inline code elements with monospace font, subtle background, and proper padding. The foundation of technical documentation.

no-js
Widely supported

Italic display heading

Italic display heading snippet with a live demo, copyable CSS, and implementation prompt.

no-js
Widely supported

Line numbers

CSS-generated line numbers in a code block using counter-reset and counter-increment with a ::before pseudo-element. No JavaScript.

no-js
Widely supported

Nav link with active state

Nav link with active state snippet with a live demo, copyable CSS, and implementation prompt.

no-js
Widely supported

Optical Sizing

CSS font-optical-sizing: auto adjusts stroke contrast and detail for the current font size — sharper small text, elegant large display.

no-js
Widely supported

Optimal reading measure

Constrain paragraph width to 45–75 characters using max-width: 65ch for optimal readability. The typographic rule every developer should know.

no-js
Widely supported

Outlined/stroke heading

Create outlined stroke text headings using -webkit-text-stroke and oklch() for bold typographic effects.

no-js
Widely supported

Perfect leading (line-height)

Optimal line-height values for headings, body text, and UI labels. Visual comparison of tight, ideal, and loose leading.

no-js
Widely supported

Responsive code block

Responsive code block snippet with a live demo, copyable CSS, and implementation prompt.

no-js
Widely supported

Responsive heading

Responsive heading snippet with a live demo, copyable CSS, and implementation prompt.

no-js
Widely supported

Responsive Variable Font Axes

Use CSS clamp() with font-variation-settings to smoothly scale weight, width, and optical size axes across viewport sizes — no JavaScript.

no-js
Widely supported

Shadow text heading

Add depth to headings with CSS text-shadow using oklch() for soft glows, hard shadows, and 3D effects.

no-js
Widely supported

Small caps

Small caps snippet with a live demo, copyable CSS, and implementation prompt.

no-js
Widely supported

Syntax highlight theme (CSS-only)

A CSS-only syntax highlight theme using span classes for keywords, strings, comments, properties, and values. No JavaScript, no library.

colorno-js
Widely supported

Tabular numbers for data

Tabular numbers for data snippet with a live demo, copyable CSS, and implementation prompt.

no-js
Widely supported

Terminal/console style

Style code blocks to look like a terminal console with monospace font, dark background, and prompt indicators.

no-js
Widely supported

text-wrap: balance paragraph

Use text-wrap: balance to evenly distribute text across lines, eliminating orphans and creating visually balanced headings and paragraphs.

no-js
Widely supported

text-wrap: pretty paragraph

Use text-wrap: pretty to prevent orphaned words on the last line of paragraphs. One CSS property replaces JavaScript text balancing.

no-js
Widely supported

Tracking (letter-spacing)

CSS letter-spacing examples from tight (-0.02em) to uppercase tracking (0.2em). Visual reference with labeled rows. Copy and go.

no-js
Widely supported

Typography Reset

A modern CSS typography reset — sensible font, line-height, and measure defaults that work across all elements out of the box.

no-js
Widely supported

Underline with offset

Underline with offset snippet with a live demo, copyable CSS, and implementation prompt.

no-js
Widely supported

Variable-weight heading

Use CSS font-variation-settings and font-weight to create headings with precise variable font weight control.

no-js
Widely supported

Visited link style

Visited link style snippet with a live demo, copyable CSS, and implementation prompt.

no-js
Widely supported

Weight Animation on Hover

Animate font-weight smoothly on hover using CSS variable fonts — butter-smooth bold transitions with no layout shift.

no-js
New feature

text-wrap: balance heading

Use text-wrap: balance to eliminate awkward single-word orphans in headings — the browser distributes text evenly across lines automatically.

typographyno-js
Widely Supported

Text gradient (background-clip)

Fill text with a gradient using background-clip: text and a transparent color — works in all modern browsers with a solid accessible fallback.

typographycolorno-js