Weaves & fabric · Grid
Canvas weave CSS texture
Canvas weave crosses fine horizontal and vertical threads at a four-pixel pitch, which at reading distance is too tight to see as lines and instead reads as tooth — the surface of primed artist canvas. It is a grid, technically, but a grid so fine that it has become a material, and it gives a flat card the feel of something you could touch.
Both directions must match in pitch and alpha, or the weave reads as an artifact. Five percent is the working alpha; the crossings double it where the threads meet. It suits portfolios, galleries and anything art-adjacent, in both modes, and it makes a good base under a very faint grain for a surface that reads as painted.
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
- Grid
- Ink
- theme foreground at 5%
- Pitch
- 4px
- Line
- 1px
- Ink color
- color-mix(in oklab, var(--foreground) 5%, transparent)
CSS
.canvas-weave {
background-image: repeating-linear-gradient(0deg, color-mix(in oklab, var(--foreground) 5%, transparent) 0 1px, transparent 1px 4px),
repeating-linear-gradient(90deg, color-mix(in oklab, var(--foreground) 5%, transparent) 0 1px, transparent 1px 4px);
}Tailwind
bg-[image:repeating-linear-gradient(0deg,_color-mix(in_oklab,_var(--foreground)_5%,_transparent)_0_1px,_transparent_1px_4px),_repeating-linear-gradient(90deg,_color-mix(in_oklab,_var(--foreground)_5%,_transparent)_0_1px,_transparent_1px_4px)]
Token
--texture-canvas-weave: repeating-linear-gradient(0deg, color-mix(in oklab, var(--foreground) 5%, transparent) 0 1px, transparent 1px 4px), repeating-linear-gradient(90deg, color-mix(in oklab, var(--foreground) 5%, transparent) 0 1px, transparent 1px 4px);
Canvas weave, answered
- How is the canvas weave texture made in CSS?
- Canvas weave is two repeating linear gradients, horizontal and vertical, crossed at the same pitch and alpha. 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(0deg, color-mix(in oklab, var(--foreground) 5%, transparent) 0 1px, transparent 1px 4px), repeating-linear-gradient(90deg, color-mix(in oklab, var(--foreground) 5%, transparent) 0 1px, transparent 1px 4px) — 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 canvas weave 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 canvas weave 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.