CSS Halftone Background

A halftone background in pure CSS: dots grow from pinpricks to solid color down the page, like comic print. One Size control keeps every dot perfectly round.

#f09f33
#f6c380
24px
.bg-halftone {
  --bg: #f09f33;
  --fg: #f6c380;
  --size: 24px;
  background-color: var(--bg);
  background-image:
    radial-gradient(circle closest-side, var(--fg) 6%, transparent calc(6% + 1px)),
    radial-gradient(circle closest-side, var(--fg) 16%, transparent calc(16% + 1px)),
    radial-gradient(circle closest-side, var(--fg) 25%, transparent calc(25% + 1px)),
    radial-gradient(circle closest-side, var(--fg) 35%, transparent calc(35% + 1px)),
    radial-gradient(circle closest-side, var(--fg) 44%, transparent calc(44% + 1px)),
    radial-gradient(circle closest-side, var(--fg) 54%, transparent calc(54% + 1px)),
    radial-gradient(circle closest-side, var(--fg) 64%, transparent calc(64% + 1px)),
    radial-gradient(circle closest-side, var(--fg) 73%, transparent calc(73% + 1px)),
    radial-gradient(circle closest-side, var(--fg) 83%, transparent calc(83% + 1px)),
    radial-gradient(circle closest-side, var(--fg) 92%, transparent calc(92% + 1px)),
    radial-gradient(circle closest-side, var(--fg) 102%, transparent calc(102% + 1px)),
    radial-gradient(circle closest-side, var(--fg) 112%, transparent calc(112% + 1px)),
    radial-gradient(circle closest-side, var(--fg) 121%, transparent calc(121% + 1px)),
    radial-gradient(circle closest-side, var(--fg) 131%, transparent calc(131% + 1px)),
    radial-gradient(circle closest-side, var(--fg) 140%, transparent calc(140% + 1px)),
    radial-gradient(circle closest-side, var(--fg) 150%, transparent calc(150% + 1px)),
    linear-gradient(transparent calc(50% + var(--size) * 9.75), var(--fg) 0);
  background-size: var(--size) var(--size), var(--size) var(--size), var(--size) var(--size), var(--size) var(--size), var(--size) var(--size), var(--size) var(--size), var(--size) var(--size), var(--size) var(--size), var(--size) var(--size), var(--size) var(--size), var(--size) var(--size), var(--size) var(--size), var(--size) var(--size), var(--size) var(--size), var(--size) var(--size), var(--size) var(--size), 100% 100%;
  background-position:
    0 calc(50% - var(--size) * 5.25),
    0 calc(50% - var(--size) * 4.25),
    0 calc(50% - var(--size) * 3.25),
    0 calc(50% - var(--size) * 2.25),
    0 calc(50% - var(--size) * 1.25),
    0 calc(50% - var(--size) * 0.25),
    0 calc(50% + var(--size) * 0.75),
    0 calc(50% + var(--size) * 1.75),
    0 calc(50% + var(--size) * 2.75),
    0 calc(50% + var(--size) * 3.75),
    0 calc(50% + var(--size) * 4.75),
    0 calc(50% + var(--size) * 5.75),
    0 calc(50% + var(--size) * 6.75),
    0 calc(50% + var(--size) * 7.75),
    0 calc(50% + var(--size) * 8.75),
    0 calc(50% + var(--size) * 9.75),
    0 0;
  background-repeat: repeat-x;
}
<div class="
  [--bg:#f09f33]
  [--fg:#f6c380]
  [--size:24px]
  [background-color:var(--bg)]
  [background-image:radial-gradient(circle_closest-side,_var(--fg)_6%,_transparent_calc(6%_+_1px)),_radial-gradient(circle_closest-side,_var(--fg)_16%,_transparent_calc(16%_+_1px)),_radial-gradient(circle_closest-side,_var(--fg)_25%,_transparent_calc(25%_+_1px)),_radial-gradient(circle_closest-side,_var(--fg)_35%,_transparent_calc(35%_+_1px)),_radial-gradient(circle_closest-side,_var(--fg)_44%,_transparent_calc(44%_+_1px)),_radial-gradient(circle_closest-side,_var(--fg)_54%,_transparent_calc(54%_+_1px)),_radial-gradient(circle_closest-side,_var(--fg)_64%,_transparent_calc(64%_+_1px)),_radial-gradient(circle_closest-side,_var(--fg)_73%,_transparent_calc(73%_+_1px)),_radial-gradient(circle_closest-side,_var(--fg)_83%,_transparent_calc(83%_+_1px)),_radial-gradient(circle_closest-side,_var(--fg)_92%,_transparent_calc(92%_+_1px)),_radial-gradient(circle_closest-side,_var(--fg)_102%,_transparent_calc(102%_+_1px)),_radial-gradient(circle_closest-side,_var(--fg)_112%,_transparent_calc(112%_+_1px)),_radial-gradient(circle_closest-side,_var(--fg)_121%,_transparent_calc(121%_+_1px)),_radial-gradient(circle_closest-side,_var(--fg)_131%,_transparent_calc(131%_+_1px)),_radial-gradient(circle_closest-side,_var(--fg)_140%,_transparent_calc(140%_+_1px)),_radial-gradient(circle_closest-side,_var(--fg)_150%,_transparent_calc(150%_+_1px)),_linear-gradient(transparent_calc(50%_+_var(--size)_*_9.75),_var(--fg)_0)]
  [background-size:var(--size)_var(--size),_var(--size)_var(--size),_var(--size)_var(--size),_var(--size)_var(--size),_var(--size)_var(--size),_var(--size)_var(--size),_var(--size)_var(--size),_var(--size)_var(--size),_var(--size)_var(--size),_var(--size)_var(--size),_var(--size)_var(--size),_var(--size)_var(--size),_var(--size)_var(--size),_var(--size)_var(--size),_var(--size)_var(--size),_var(--size)_var(--size),_100%_100%]
  [background-position:0_calc(50%_-_var(--size)_*_5.25),_0_calc(50%_-_var(--size)_*_4.25),_0_calc(50%_-_var(--size)_*_3.25),_0_calc(50%_-_var(--size)_*_2.25),_0_calc(50%_-_var(--size)_*_1.25),_0_calc(50%_-_var(--size)_*_0.25),_0_calc(50%_+_var(--size)_*_0.75),_0_calc(50%_+_var(--size)_*_1.75),_0_calc(50%_+_var(--size)_*_2.75),_0_calc(50%_+_var(--size)_*_3.75),_0_calc(50%_+_var(--size)_*_4.75),_0_calc(50%_+_var(--size)_*_5.75),_0_calc(50%_+_var(--size)_*_6.75),_0_calc(50%_+_var(--size)_*_7.75),_0_calc(50%_+_var(--size)_*_8.75),_0_calc(50%_+_var(--size)_*_9.75),_0_0]
  [background-repeat:repeat-x]
"></div>
<!doctype html>
<html lang="en">
<head>
  <meta charset="utf-8">
  <meta name="viewport" content="width=device-width, initial-scale=1">
  <title>Halftone — CSS background</title>
  <style>
    html, body { height: 100%; margin: 0; }
    .bg-halftone {
      --bg: #f09f33;
      --fg: #f6c380;
      --size: 24px;
      background-color: var(--bg);
      background-image:
        radial-gradient(circle closest-side, var(--fg) 6%, transparent calc(6% + 1px)),
        radial-gradient(circle closest-side, var(--fg) 16%, transparent calc(16% + 1px)),
        radial-gradient(circle closest-side, var(--fg) 25%, transparent calc(25% + 1px)),
        radial-gradient(circle closest-side, var(--fg) 35%, transparent calc(35% + 1px)),
        radial-gradient(circle closest-side, var(--fg) 44%, transparent calc(44% + 1px)),
        radial-gradient(circle closest-side, var(--fg) 54%, transparent calc(54% + 1px)),
        radial-gradient(circle closest-side, var(--fg) 64%, transparent calc(64% + 1px)),
        radial-gradient(circle closest-side, var(--fg) 73%, transparent calc(73% + 1px)),
        radial-gradient(circle closest-side, var(--fg) 83%, transparent calc(83% + 1px)),
        radial-gradient(circle closest-side, var(--fg) 92%, transparent calc(92% + 1px)),
        radial-gradient(circle closest-side, var(--fg) 102%, transparent calc(102% + 1px)),
        radial-gradient(circle closest-side, var(--fg) 112%, transparent calc(112% + 1px)),
        radial-gradient(circle closest-side, var(--fg) 121%, transparent calc(121% + 1px)),
        radial-gradient(circle closest-side, var(--fg) 131%, transparent calc(131% + 1px)),
        radial-gradient(circle closest-side, var(--fg) 140%, transparent calc(140% + 1px)),
        radial-gradient(circle closest-side, var(--fg) 150%, transparent calc(150% + 1px)),
        linear-gradient(transparent calc(50% + var(--size) * 9.75), var(--fg) 0);
      background-size: var(--size) var(--size), var(--size) var(--size), var(--size) var(--size), var(--size) var(--size), var(--size) var(--size), var(--size) var(--size), var(--size) var(--size), var(--size) var(--size), var(--size) var(--size), var(--size) var(--size), var(--size) var(--size), var(--size) var(--size), var(--size) var(--size), var(--size) var(--size), var(--size) var(--size), var(--size) var(--size), 100% 100%;
      background-position:
        0 calc(50% - var(--size) * 5.25),
        0 calc(50% - var(--size) * 4.25),
        0 calc(50% - var(--size) * 3.25),
        0 calc(50% - var(--size) * 2.25),
        0 calc(50% - var(--size) * 1.25),
        0 calc(50% - var(--size) * 0.25),
        0 calc(50% + var(--size) * 0.75),
        0 calc(50% + var(--size) * 1.75),
        0 calc(50% + var(--size) * 2.75),
        0 calc(50% + var(--size) * 3.75),
        0 calc(50% + var(--size) * 4.75),
        0 calc(50% + var(--size) * 5.75),
        0 calc(50% + var(--size) * 6.75),
        0 calc(50% + var(--size) * 7.75),
        0 calc(50% + var(--size) * 8.75),
        0 calc(50% + var(--size) * 9.75),
        0 0;
      background-repeat: repeat-x;
    }
  </style>
</head>
<body class="bg-halftone"></body>
</html>

Save the pattern as an image, with your current colors and settings.

Halftone in other colors

Click a color to try it in the preview above, then copy the code.

Browse by color: Red · Orange · Yellow · Green · Teal · Blue · Purple · Pink

How the halftone pattern works

A halftone builds shading out of dots that change size. CSS can’t change a dot’s size inside one repeating tile, so every row is its own radial-gradient() layer: sixteen rows of dots, each bigger than the last, from 6% of the cell to 150%.

Every row is a square cell exactly --size wide and tall, and uses background-repeat: repeat-x so it repeats across the width only. Because everything is in pixels, resizing the window never stretches the dots. Rows are placed with calc(50% ± rows × var(--size)), so the ramp sits in the middle of the element.

Past 100% the dots touch, and the square cell clips them into rounded squares until the gaps close. A final linear-gradient() then fills everything below the ramp with solid --fg, so the column continues as full ink to the bottom. A bigger --size makes a taller ramp. A smaller one leaves more plain background above and more solid color below.

The ramp sits 2.25 rows below the middle, because the last rows already read as solid. That shift keeps the visible dots looking centered at every size. The Tailwind tab outputs the same layers for Tailwind v4.