Stripes & rulings · Lines
Hairline stripes CSS texture
Hairline stripes are one-pixel diagonal rules at a sixteen-pixel pitch: the wide-band stripe with the band shrunk to a hairline, so the surface keeps the diagonal energy and loses the weight. It is the lightest directional texture in the catalog, and the one to reach for when a surface needs movement without noise.
It works behind cards, in table headers, and as the fill of a disabled or placeholder region, where the diagonal reads as not-yet. Six percent is a working alpha. Cross it with its mirror and you have a diamond lattice; flatten the angle to zero and you have a ruling. Like every hairline it can moiré under small text on low-density displays.
Under text
Reading-size copy on the texture, so the alpha is judged by legibility rather than by taste.
A card on top
Separated without a second border.
Recipe
- Kind
- Lines
- Ink
- theme foreground at 6%
- Pitch
- 16px
- Line
- 1px
- Angle
- 45°
- Ink color
- color-mix(in oklab, var(--foreground) 6%, transparent)
CSS
.hairline-stripes {
background-image: repeating-linear-gradient(45deg, color-mix(in oklab, var(--foreground) 6%, transparent) 0 1px, transparent 1px 16px);
}Tailwind
bg-[image:repeating-linear-gradient(45deg,_color-mix(in_oklab,_var(--foreground)_6%,_transparent)_0_1px,_transparent_1px_16px)]
Token
--texture-hairline-stripes: repeating-linear-gradient(45deg, color-mix(in oklab, var(--foreground) 6%, transparent) 0 1px, transparent 1px 16px);
Hairline stripes, answered
- How is the hairline stripes texture made in CSS?
- Hairline stripes is one repeating linear gradient, where the first stop is the band and the period is the pitch. Its ink is the theme's foreground color mixed to 6% with color-mix, so the same declaration re-tints itself when the theme switches between light and dark mode. The full declaration is repeating-linear-gradient(45deg, color-mix(in oklab, var(--foreground) 6%, transparent) 0 1px, transparent 1px 16px) — copy the CSS rule, the Tailwind classes or the custom property above, or open it in the playground to change the pitch, the ink or the alpha.
- How do I use the hairline stripes texture in Tailwind CSS?
- Copy the Tailwind tab: it is one or two arbitrary-value classes, bg-[image:…] for the gradient and bg-[size:…] for the pitch where the kind needs one, with spaces written as underscores. Tailwind v3 and v4 both accept the form. For a value you reuse across the site, register the Token tab's custom property in your theme and reference it from a utility.
- How subtle should the hairline stripes texture be?
- Most line textures work between three and eight percent of the foreground; this preset sits at 6%. Where two layers cross, the crossings stack to roughly double strength, so halve the per-layer alpha you would use for a single stripe.