StealThis .dev

Dot Pattern

A repeating dot pattern background using radial-gradient, fully customizable via CSS custom properties for spacing, radius, and color.

Open in Lab
css javascript vue svelte
Targets: TS JS HTML React Vue Svelte

Code

Dot Pattern

A sleek repeating dot pattern background using radial-gradient, perfect for adding subtle texture to dark-themed sections.

How it works

A single radial-gradient creates a circle at the center of a repeating tile. The background-size property controls dot spacing, and the gradient stop controls dot radius. Everything is driven by CSS custom properties.

Customization

VariableDefaultDescription
--dot-spacing24pxDistance between dot centers
--dot-radius1pxDot radius
--dot-colorrgba(255,255,255,0.15)Dot fill color
--dot-bg#0a0a0aBackground color

When to use it

  • Subtle section backgrounds
  • Card or modal backdrops
  • Empty state containers
  • Behind hero typography