Texture playground

Stripes & rulings · Lines

Pinstripe CSS texture

Pinstripe is a vertical one-pixel rule every six pixels: hairlines so close they read as a fabric rather than as lines, the suiting pattern the name comes from. It is a texture of formality and finance, and it works because it is directional — the eye reads vertical lines as height, which makes a surface feel taller and more composed.

It suits a sidebar, a footer, a pricing card, or any surface that should feel considered without being decorated. Keep the alpha low — five percent is plenty at this pitch — and never widen the stripe; at two pixels it stops being a pinstripe and becomes a barcode. It works in both modes because it mixes from the foreground.

Swatch
Under text
Under a card

Recipe

Kind
Lines
Ink
theme foreground at 5%
Pitch
6px
Line
1px
Angle
90°
Ink color
color-mix(in oklab, var(--foreground) 5%, transparent)

CSS

.pinstripe {
  background-image: repeating-linear-gradient(90deg, color-mix(in oklab, var(--foreground) 5%, transparent) 0 1px, transparent 1px 6px);
}

Tailwind

bg-[image:repeating-linear-gradient(90deg,_color-mix(in_oklab,_var(--foreground)_5%,_transparent)_0_1px,_transparent_1px_6px)]

Token

--texture-pinstripe: repeating-linear-gradient(90deg, color-mix(in oklab, var(--foreground) 5%, transparent) 0 1px, transparent 1px 6px);

Pinstripe, answered

How is the pinstripe texture made in CSS?
Pinstripe 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 5% 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(90deg, color-mix(in oklab, var(--foreground) 5%, transparent) 0 1px, transparent 1px 6px) — 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 pinstripe 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 pinstripe texture be?
Most line textures work between three and eight percent of the foreground; this preset sits at 5%. Where two layers cross, the crossings stack to roughly double strength, so halve the per-layer alpha you would use for a single stripe.

More stripes & rulings textures

We'd like to use Google cookies to understand how Nodlume is used and to measure our advertising. Nothing loads until you choose, and declining does not affect anything in the app.