CSS Plaid Background

A plaid (tartan) background in pure CSS: see-through bands that cross and deepen, plus thin accent lines. Set the tile size and band width live, then copy it.

#880088
#b560b5
72px
40%
.bg-plaid {
  --bg: #880088;
  --fg: #b560b5;
  --size: 72px;
  --band: 40%;
  background-color: var(--bg);
  background-image:
    linear-gradient(transparent calc(50% + var(--band) / 2 - 1px), var(--fg) 0 calc(50% + var(--band) / 2 + 1px), transparent 0),
    linear-gradient(90deg, transparent calc(50% + var(--band) / 2 - 1px), var(--fg) 0 calc(50% + var(--band) / 2 + 1px), transparent 0),
    linear-gradient(color-mix(in srgb, var(--fg) 45%, transparent) var(--band), transparent 0),
    linear-gradient(90deg, color-mix(in srgb, var(--fg) 45%, transparent) var(--band), transparent 0);
  background-size: var(--size) var(--size);
}
<div class="
  [--bg:#880088]
  [--fg:#b560b5]
  [--size:72px]
  [--band:40%]
  [background-color:var(--bg)]
  [background-image:linear-gradient(transparent_calc(50%_+_var(--band)_/_2_-_1px),_var(--fg)_0_calc(50%_+_var(--band)_/_2_+_1px),_transparent_0),_linear-gradient(90deg,_transparent_calc(50%_+_var(--band)_/_2_-_1px),_var(--fg)_0_calc(50%_+_var(--band)_/_2_+_1px),_transparent_0),_linear-gradient(color-mix(in_srgb,_var(--fg)_45%,_transparent)_var(--band),_transparent_0),_linear-gradient(90deg,_color-mix(in_srgb,_var(--fg)_45%,_transparent)_var(--band),_transparent_0)]
  [background-size:var(--size)_var(--size)]
"></div>
<!doctype html>
<html lang="en">
<head>
  <meta charset="utf-8">
  <meta name="viewport" content="width=device-width, initial-scale=1">
  <title>Plaid — CSS background</title>
  <style>
    html, body { height: 100%; margin: 0; }
    .bg-plaid {
      --bg: #880088;
      --fg: #b560b5;
      --size: 72px;
      --band: 40%;
      background-color: var(--bg);
      background-image:
        linear-gradient(transparent calc(50% + var(--band) / 2 - 1px), var(--fg) 0 calc(50% + var(--band) / 2 + 1px), transparent 0),
        linear-gradient(90deg, transparent calc(50% + var(--band) / 2 - 1px), var(--fg) 0 calc(50% + var(--band) / 2 + 1px), transparent 0),
        linear-gradient(color-mix(in srgb, var(--fg) 45%, transparent) var(--band), transparent 0),
        linear-gradient(90deg, color-mix(in srgb, var(--fg) 45%, transparent) var(--band), transparent 0);
      background-size: var(--size) var(--size);
    }
  </style>
</head>
<body class="bg-plaid"></body>
</html>

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

Plaid 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 plaid pattern works

Plaid is woven from stripes that run both ways and show through each other. The bottom two layers are wide bands: one horizontal and one turned 90deg, each covering the first --band of the tile. Their color is color-mix(in srgb, var(--fg) 45%, transparent), a see-through version of the foreground. Where a horizontal band crosses a vertical one, the two layers stack and the color deepens, which gives plaid its checked squares.

The top two layers add thin 2px accent lines in both directions, the fine overcheck you see on real tartan. Each sits at 50% + var(--band) / 2, the middle of the open space after the band, so it stays centered as the bands grow or shrink.

--size sets how big each repeat is and --band how wide the bands are. Set --band to 50% for gingham, the simple picnic-blanket check. The pattern uses only --fg and --bg, so recoloring is still just two variables.

Use plaid for autumn and holiday themes, outdoor and lumberjack styles, and cozy product pages. The Tailwind tab outputs the same layers for Tailwind v4.