CSS Argyle Background

An argyle pattern in pure CSS: tall diamonds in two shades crossed by thin diagonal lines, like a classic sweater. Set the diamond size and colors live.

#cc3f47
#df878c
48px
.bg-argyle {
  --bg: #cc3f47;
  --fg: #df878c;
  --size: 48px;
  background-color: var(--bg);
  background-image:
    linear-gradient(to bottom right, transparent calc(50% - 1px), var(--fg) calc(50% - 0.5px) calc(50% + 0.5px), transparent calc(50% + 1px)),
    linear-gradient(to bottom left, transparent calc(50% - 1px), var(--fg) calc(50% - 0.5px) calc(50% + 0.5px), transparent calc(50% + 1px)),
    linear-gradient(to bottom right, color-mix(in srgb, var(--fg) 45%, var(--bg)) 25%, transparent 0),
    linear-gradient(to bottom left, color-mix(in srgb, var(--fg) 45%, var(--bg)) 25%, transparent 0),
    linear-gradient(to top right, color-mix(in srgb, var(--fg) 45%, var(--bg)) 25%, transparent 0),
    linear-gradient(to top left, color-mix(in srgb, var(--fg) 45%, var(--bg)) 25%, transparent 0);
  background-size: var(--size) calc(var(--size) * 1.5);
}
<div class="
  [--bg:#cc3f47]
  [--fg:#df878c]
  [--size:48px]
  [background-color:var(--bg)]
  [background-image:linear-gradient(to_bottom_right,_transparent_calc(50%_-_1px),_var(--fg)_calc(50%_-_0.5px)_calc(50%_+_0.5px),_transparent_calc(50%_+_1px)),_linear-gradient(to_bottom_left,_transparent_calc(50%_-_1px),_var(--fg)_calc(50%_-_0.5px)_calc(50%_+_0.5px),_transparent_calc(50%_+_1px)),_linear-gradient(to_bottom_right,_color-mix(in_srgb,_var(--fg)_45%,_var(--bg))_25%,_transparent_0),_linear-gradient(to_bottom_left,_color-mix(in_srgb,_var(--fg)_45%,_var(--bg))_25%,_transparent_0),_linear-gradient(to_top_right,_color-mix(in_srgb,_var(--fg)_45%,_var(--bg))_25%,_transparent_0),_linear-gradient(to_top_left,_color-mix(in_srgb,_var(--fg)_45%,_var(--bg))_25%,_transparent_0)]
  [background-size:var(--size)_calc(var(--size)_*_1.5)]
"></div>
<!doctype html>
<html lang="en">
<head>
  <meta charset="utf-8">
  <meta name="viewport" content="width=device-width, initial-scale=1">
  <title>Argyle — CSS background</title>
  <style>
    html, body { height: 100%; margin: 0; }
    .bg-argyle {
      --bg: #cc3f47;
      --fg: #df878c;
      --size: 48px;
      background-color: var(--bg);
      background-image:
        linear-gradient(to bottom right, transparent calc(50% - 1px), var(--fg) calc(50% - 0.5px) calc(50% + 0.5px), transparent calc(50% + 1px)),
        linear-gradient(to bottom left, transparent calc(50% - 1px), var(--fg) calc(50% - 0.5px) calc(50% + 0.5px), transparent calc(50% + 1px)),
        linear-gradient(to bottom right, color-mix(in srgb, var(--fg) 45%, var(--bg)) 25%, transparent 0),
        linear-gradient(to bottom left, color-mix(in srgb, var(--fg) 45%, var(--bg)) 25%, transparent 0),
        linear-gradient(to top right, color-mix(in srgb, var(--fg) 45%, var(--bg)) 25%, transparent 0),
        linear-gradient(to top left, color-mix(in srgb, var(--fg) 45%, var(--bg)) 25%, transparent 0);
      background-size: var(--size) calc(var(--size) * 1.5);
    }
  </style>
</head>
<body class="bg-argyle"></body>
</html>

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

Argyle 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 argyle pattern works

Argyle is a knit pattern of diamonds in alternating shades, crossed by thin diagonal lines. Here the tile is --size wide and 1.5 times as tall, which stretches the diamonds into argyle’s classic tall shape.

The diamonds come from the tile’s corners. Four linear-gradient() layers use the corner keywords (to bottom right, to bottom left and so on) with a hard stop at 25%. For corner-keyword gradients, 25% lands exactly on the midpoints of the two nearest edges, so each layer fills one corner triangle. The corners of neighboring tiles meet to form the second set of diamonds, in a 45% color-mix() of --fg and --bg. The middle of the tile stays --bg.

The top two layers are the lines. Each puts a 1px line of --fg on the tile’s diagonal (the 50% mark), so the lines pass through the middle of every diamond, parallel to their edges.

Use it for menswear and golf brands, preppy and collegiate themes, and cozy winter designs.