CSS Repeating Pattern Generator
Generate CSS pure patterns (checker, stripes, dots, hex, waves) with repeating gradients.
CSS patterns: repeating backgrounds without images
A CSS pattern is a repetitive background built entirely with CSS gradients, no image file required. The technique was popularised by Lea Verou in her landmark 2010 CSS3 Patterns Gallery and has been a part of the web design vocabulary ever since. Because the pattern is rendered by the browser's native paint pipeline, it is resolution-independent, comically small in bytes and scales sharply on retina screens without serving multiple raster assets.
The two building blocks are linear-gradient and radial-gradient, each supporting a repeating- variant that does the tiling for you. Diagonal stripes, for example, are a one-liner:
background:
repeating-linear-gradient(45deg,
#ffffff 0 10px,
#1f2937 10px 20px);
Common pattern recipes
- Stripes β one
repeating-linear-gradient, any angle. - Checkerboard β two
linear-gradients rotated 90Β° withbackground-sizedefining the cell. - Dots / polka dots β a single
radial-gradientwithbackground-sizefor spacing. - Plus / cross β two thin
linear-gradientstripes overlapped at 90Β°. - Diamond / herringbone β gradient stacks with offset
background-position. - Grid lines β perfect for design canvases; one gradient horizontal, one vertical.
- Conic / pie β modern
conic-gradientfor sunbursts and pies.
CSS pattern vs SVG vs PNG
For simple geometric tiles β stripes, dots, grids, checkers β pure CSS wins on every axis: no HTTP request, scales perfectly, easy to tweak via custom properties. SVG takes over when the motif involves curves, paths or complex shapes (waves, hexagons with rounded corners, custom icons), and dedicated galleries like heropatterns.com live in that space. A repeated PNG is rarely the right answer in 2026 β it loses sharpness on retina, costs an HTTP request and is bigger than the equivalent CSS in almost every case.
Working with transparency and custom properties
Gradients accept rgba() and color-mix() values, so you can paint a pattern over a photographic background while keeping the imagery readable. Plugging the colours into CSS custom properties makes themes trivial:
.dots {
--c: #3b82f6;
background: radial-gradient(var(--c) 2px, transparent 2px);
background-size: 16px 16px;
}
Tailwind and arbitrary values
Tailwind v3+ supports arbitrary value syntax for any utility. You can drop a pattern straight into the class list:
<div class="bg-[radial-gradient(theme(colors.blue.500)_2px,transparent_2px)] bg-[length:16px_16px]"></div>
FAQ
Can a CSS pattern use transparency? Yes β gradients accept rgba(), so you can lay a pattern over a photo or a gradient without hiding the layer below.
Does it print correctly? Mostly β most browsers respect background printing if the user enables "Background graphics". For brochures, use print-color-adjust: exact to keep the pattern visible.
Is it lighter than a repeated PNG? Almost always β a CSS pattern is a few dozen bytes inside your stylesheet and produces no HTTP request, while a PNG tile costs at least a kilobyte plus a request.
Can I make hexagonal or complex curved patterns? Hex is possible with three stacked gradients, but anything with smooth curves is better served by an SVG tile from heropatterns.com or a similar gallery.
Related Tools
SVG Pattern Generator
Create repeatable SVG patterns for website backgrounds: dots, lines, checkerboard, grid, diagonal and hexagons. Customize colors and size. Copy the SVG code or CSS background-image.
SVG Zigzag Pattern Generator
Generate a tileable zigzag (chevron) pattern in SVG, adjusting amplitude, color and thickness. Great for website backgrounds and textures β copy the code.
CSS Checker Pattern Generator
Generate a checkerboard pattern in pure CSS using gradients, with no images. Adjust colors and size, preview it and copy the ready code for your site.
SVG Brick Pattern Generator
Generates a tileable SVG simulating brick masonry with alternating offset, parameterizing dimensions and mortar.
SVG Honeycomb Pattern Generator
Generate a tileable honeycomb (hexagon) pattern in SVG, adjusting size, gap and colors. Great for website backgrounds, textures and design β copy the code.
SVG Diagonal Stripes Pattern Generator
Generate a tileable diagonal stripes pattern in SVG, with two colors and adjustable angle and width. Great for website backgrounds and textures.