Task path / input to outcome
How to create a CSS background pattern
- 01
Pick a pattern
Open Pattern and choose Dots, Grid, or Diagonal. All three are built from CSS gradients alone — no image file is involved at any point. Switching between them keeps your tile, mark, and color values, so comparing styles costs nothing. The default 28 px dot grid is a quiet place to start.
- 02
Set the tile
Choose a Tile size from 8 to 96 px and a Mark width from 1 to 16 px. The mark cannot exceed half the tile size; if it does, the status shows CHECK VALUES with the exact rule.
- 03
Choose the two colors
Pattern color draws the marks and Canvas color fills the ground beneath them. Subtle patterns come from low contrast between the two — a mark only slightly darker than the canvas reads as texture rather than decoration.
- 04
Judge the repeat at real scale
The preview tiles the result across the whole panel, which is where weak contrast and cramped tiles reveal themselves. As a rule of thumb, keep the mark well under half the tile: a 2 px mark on a 28 px tile reads as texture, not noise.
- 05
Copy the pattern CSS
Press Copy CSS or Download .css to save toolars-background-pattern.css. The .pattern rule is three declarations — background-color, background-image, and background-size — ready for any element.
- 06
Apply and adapt the rule
The rule drops onto any element without layout side effects, since it only paints the background. Adjust background-size later to change the pattern density, and lower the contrast between the two colors — rather than shrinking the mark — when a pattern competes with text.