Toolstia / CSS pattern generator
CSS pattern generator
Create repeating background patterns without any image files. Pick stripes, diagonal stripes, polka dots, a checkerboard or grid lines, set two colours and a size, and copy the CSS. The preview updates as you type.
Patterns are made with CSS gradients only, so there are no image files to load.
How it works
- Choose a pattern type.
- Enter the two colours as hex codes and set the size.
- Copy the CSS and paste it into your stylesheet.
How the patterns work
Each pattern is built from CSS gradients. Stripes use a repeating linear gradient, dots use a radial gradient, and the checkerboard uses a conic gradient that repeats every two squares.
Why no images
Gradient patterns load instantly, scale to any screen and need no extra request, so they are good for backgrounds, loaders and placeholders.
Size and thickness
Size is the width of one stripe or the spacing of dots and lines. For dots and grid lines you also set the radius or line thickness, from 1 pixel up to the size.
Selector
Change the selector to match your element, such as .hero or #banner.
Questions
Do I need a vendor prefix?
No. These gradient functions work in all current browsers, and conic-gradient has been supported for years. Everything happens in your browser, and nothing you enter is sent anywhere.
Can I use other colours with transparency?
The tool takes solid hex colours. You can edit the copied CSS by hand to use rgba values.
Why do my dots look soft at the edge?
The dot edge is one pixel of blending, which avoids jagged circles. Edit the second stop in the copied CSS for a harder edge.