Drawing a Houndstooth Pattern in CSS

Published: (January 10, 2026 at 06:17 PM EST)
1 min read
Source: Dev.to

Source: Dev.to

Introduction

I associate the houndstooth pattern with childhood—I remember seeing it everywhere when I was little, only for it to disappear later on. From a CSS perspective, the pattern is actually quite simple and can be created with just two gradients:

  • Conic gradient – generates the white and black box pattern.
  • Repeating linear gradient (or a regular linear gradient) – creates the diagonal lines.

For convenience, define a custom property for the size so you can adjust the pattern by changing a single value.

CSS Implementation

body {
  --size: 100px;                     /* Adjust this value to change the pattern size */
  background-size: var(--size) var(--size);
  background-image:
    conic-gradient(#fff 25%, #0000 0 50%, #000 0 75%, #0000 0),
    repeating-linear-gradient(
      135deg,
      #fff 0 12.5%,
      #000 0 25%,
      #fff 0 37.5%,
      #000 0 62.5%
    );
}

How it works

  • --size controls the width and height of each repeat of the pattern.
  • The conic-gradient creates the classic checker‑board squares of the houndstooth.
  • The repeating-linear-gradient adds the diagonal “tooth” lines at a 135° angle.

Demo

Video generating the pattern in real time with CSS.

(Insert video embed or link here.)

And that’s how you draw a houndstooth pattern with CSS. :)

Back to Blog

Related posts

Read more »

CSS Web Components for marketing sites

Article URL: https://hawkticehurst.com/2024/11/css-web-components-for-marketing-sites/ Comments URL: https://news.ycombinator.com/item?id=46679907 Points: 28 Co...

CSS Optical Illusions

!Cover image for CSS Optical Illusionshttps://media2.dev.to/dynamic/image/width=1000,height=420,fit=cover,gravity=auto,format=auto/https%3A%2F%2Fdev-to-uploads....