· 2 min read · Web development, Tools
CSS Backgrounds: patterns and gradients without images

CSSBackgrounds.com is a free library of 36 patterns and 26 gradients made only with CSS. You pick one, change the colors, and copy the code. No image files needed.
Each pattern has its own page with live controls. The code comes as plain CSS, Tailwind classes or a full HTML demo. Colors and sizes are custom properties like --bg, --fg and --size, so recoloring is one line. The site says it is free for personal and commercial use, with no attribution. That is the site's own claim. It is run by Visiwig LLC, and the site names no person or contact address.
The trick behind it is old and neat. Hard color stops in gradients make stripes, and layered gradients make grids, checks and dots. Lea Verou showed this years ago in her CSS3 Patterns Gallery. Sharp at any zoom, easy to change later.
What I'd check before using one
- Text contrast. WCAG wants 4.5:1 for normal text. WebAIM says WCAG does not say how to measure text over gradients and advises testing the spot where contrast is lowest. Busy patterns make that spot easy to miss. Keep patterns quiet behind text.
- Motion. The site has an Animated Stripes pattern. Its code turns the animation off under
prefers-reduced-motion: reduce. That matters, because motion can trigger discomfort for people with vestibular disorders. I only checked that one pattern. - Performance. Web.dev's animation guide says to stick to
transformandopacity. The stripes animatebackground-position, which that guide does not cover. The cost is unconfirmed, so test on a weak phone. A large fixed pattern behind a whole page is the one I'd watch. - Dark mode. I found nothing about it on the site. The custom properties make a
prefers-color-schemeswap easy.
Alternatives
MagicPattern has 50+ patterns and also exports images. Pattern Craft focuses on React and Tailwind.
A pattern is a good fit when you want texture. If you want soft light instead, you can build blurred gradient blobs with mix-blend-mode in pure CSS too.
Sources
- CSSBackgrounds.com - the site, its pattern list and licence claim
- CSSBackgrounds About - maker (Visiwig LLC), technique, licence wording
- Animated Stripes - sample code, reduced-motion handling
- MDN: Using CSS gradients - hard stops, layering
- MDN: prefers-reduced-motion - why motion matters
- WebAIM: Contrast and Color Accessibility - ratios, text over gradients
- web.dev: Animations guide - cheap vs costly animation
- CSS3 Patterns Gallery, Lea Verou - the original gradient pattern collection
- MagicPattern CSS backgrounds - comparison
- Pattern Craft (search listing) - comparison; only seen as a search result
- CSS-Tricks: CSS3 gradients - gradients as image replacement, no benchmarks
Comments