Examples

Pure CSS diagonal optical illusion with parallel lines distorted on a yellow background, revealed on hover.
CSS ·1 kB

Diagonal Illusion Pattern in Pure CSS

A pure CSS diagonal optical illusion that distorts parallel lines without JavaScript. Combines repeating-linear-gradient grid stripes with rotated conic-gradient elements on body::before and body::after pseudo-elements. Hovering transitions the @property --color variable to transparent, removing the visual interference to demonstrate that all diagonal lines are strictly parallel.

Level
Intermediate
Best for
Interactive Demos · Hero Backgrounds · Creative Canvas
Browsers
Chrome · Edge · Safari · Firefox
Highlights
Optical Illusion · Pure CSS · Animated Property · Hover Reveal
Loading preview
/*
optical effect
The diagonal black lines are parallel, but they look like they are not. Mouse over to reveal
*/
@property --color {
  syntax: '<color>';
  initial-value: #f00;
  inherits: true;
}

body {
  --color: #000;
  margin: 0;
  font-size: 1vmax;
  height: 100vh;
  overflow: hidden;
  transition: --color 1s;
  background: #fd5;
}

body:hover {
  --color: #0000;
}

body::before {
  content: "";
  position: absolute;
  top: 50%;
  left: 50%;
  translate: -50% -50%;
  width: 300em;
  height: 300em;
  background:
    repeating-linear-gradient(#0000 0 18em, #000 0 20em),
    conic-gradient(at 1em 8em, #0000 75%, var(--color) 0) 0 -5em / 2em 20em;
  transform: skewY(-45deg);
}

body::after {
  content: "";
  position: absolute;
  top: 50%;
  left: 50%;
  translate: -50% -50%;
  width: 300em;
  height: 300em;
  background:
    repeating-linear-gradient(#0000 0 18em, #000 0 20em),
    conic-gradient(at 1em 8em, #0000 75%, var(--color) 0) 0 -5em / 2em 20em;
  transform: rotate(90deg) skewY(45deg) translate(0.25em, 12em);
}
  • Colors / Themes: Change canvas color via background: #fd5 on body. Adjust illusion tile color --color: #000 and initial value initial-value: #f00 inside @property --color. Tweak hover reveal state via --color: #0000.
  • Gradients & Visual Effects: Modify grid line spacing by editing repeating-linear-gradient(#0000 0 18em, #000 0 20em) stop offsets. Alter distortion block positioning through conic-gradient(at 1em 8em, #0000 75%, var(--color) 0) 0 -5em / 2em 20em inside pseudo-elements.
  • Sizing, Layout & Scales: Change viewport scale density via font-size: 1vmax on body. Adjust tilt severity by modifying transform: skewY(-45deg) on body::before and transform: rotate(90deg) skewY(45deg) on body::after.
Pure CSS Cafe Wall optical illusion with parallel lines distorted by conic gradients, revealed on hover.
CSS ·1 kB

Optical Illusion Pattern in Pure CSS

An optical illusion rendered entirely in CSS using zero HTML elements. Employs pseudo-elements with skewed repeating-linear-gradient and conic-gradient layers to create the perception of non-parallel lines. Hovering over the viewport transitions the @property --color variable to transparent, instantly disabling the visual distortion and revealing parallel horizontal lines.

Level
Intermediate
Best for
Interactive Demos · Hero Backgrounds · Creative Canvas
Browsers
Chrome · Edge · Safari · Firefox
Highlights
Optical Illusion · Pure CSS · Animated Property · Hover Reveal
Loading preview
/*
optical effect
The black lines are parallel, but they look like they are not. Mouse over to reveal
*/
@property --color {
  syntax: '<color>';
  initial-value: #f00;
  inherits: true;
}

body {
  --color: #f55;
  margin: 0;
  font-size: 1vmax;
  height: 100vh;
  overflow: hidden;
  transition: --color 1s;
}

body:hover {
  --color: #0000;
}

body::before {
  content: "";
  position: absolute;
  top: 50%;
  left: 50%;
  translate: -50% -50%;
  width: 300em;
  height: 300em;
  background:
    repeating-linear-gradient(#0000 0 18em, #000 0 20em),
    conic-gradient(at 1.25em 10em, #0000 75%, var(--color) 0) 0 -6em / 2.5em 20em;
  transform: skewY(-45deg);
}

body::after {
  content: "";
  position: absolute;
  top: 50%;
  left: 50%;
  translate: -50% -50%;
  width: 300em;
  height: 300em;
  background:
    repeating-linear-gradient(#0000 0 18em, #000 0 20em),
    conic-gradient(at 1.25em 10em, #0000 75%, var(--color) 0) 0 -6em / 2.5em 20em;
  transform: rotate(90deg) skewY(45deg) translate(0.25em, 12em);
}
  • Colors / Themes: Change distortion tile colors by modifying --color: #f55 on body and initial-value #f00 inside @property --color. Update hover transparency target --color: #0000 to alter reveal contrast.
  • Gradients & Visual Effects: Adjust line frequency by tweaking repeating-linear-gradient(#0000 0 18em, #000 0 20em) offsets inside body::before and body::after. Modify pattern angles via conic-gradient(at 1.25em 10em, ...) tile dimensions / 2.5em 20em.
  • Sizing, Layout & Scales: Rescale pattern density by altering font-size: 1vmax on body. Tweak illusion distortion strength by adjusting skew angles transform: skewY(-45deg) and skewY(45deg).
Grid of three textured teal cards featuring shifted 3D overlapping backdrop layers on a base64 speculary-lit SVG noise background.
SVG·HTML/Pug·CSS/Sass

Textured 3D Layered Grid Cards

This lightweight grid layout styles nested cards with an organic paper feel entirely through vector code. It utilizes a base64-encoded SVG filter featuring specular lighting and turbulence to inject a matte noise texture over solid colors. By applying an offset ::after pseudo-element rotated by 8deg with mix-blend-mode: overlay, each card gains a shifted tactile depth layer without heavy graphics.

Level
Beginner
Browsers
Chrome 105+ · Edge 105+ · Firefox 103+ · Safari 16+
Highlights
SVG Specular Noise · Layered Overlay Shifting · Conic Gradient BG
Interactive procedural graph notebook paper background generated entirely with multiple stacked CSS gradients and adjustable gap sizing.
HTML·CSS·JavaScript

Procedural CSS Gradient Grid Background

An interactive graph notebook paper pattern drawn entirely via stacked, layered CSS gradients. By combining major and minor linear grid lines, radial cross masks, and corner border offsets, it forms a fully customizable procedural background. It utilizes CSS @property Houdini variables to smoothly transition gap sizing updates, alongside dynamic theme and color hue tuning.

Level
Intermediate
Browsers
Chrome 110+ · Edge 110+ · Firefox 128+ · Safari 16.4+
Highlights
Procedural Gradients · Houdini Transition · Adaptive Themes
Interactive Café Wall optical illusion built entirely with pure CSS conic gradients, shifting row positions on hover to reveal parallel lines.
CSS

Pure CSS Café Wall Optical Illusion

An interactive pure-CSS representation of the classic Café Wall optical illusion. Built with zero HTML markup, the layout layers gray linear separators and offset black-and-white conic gradients to create a pattern where perfectly parallel lines appear tilted. Hovering over the page realigns the checkerboard columns to immediately debunk the cognitive illusion.

Level
Intermediate
Browsers
Chrome 69+ · Edge 79+ · Firefox 83+ · Safari 12.1+
Highlights
Optical Illusion · Conic Gradients · Zero-HTML Layout
Pure CSS Ehrenstein optical illusion featuring aligned linear segments that trick the brain into perceiving non-existent white circular discs.
CSS

Pure CSS Ehrenstein Optical Illusion

An elegant pure-CSS implementation of the classic Ehrenstein optical illusion. Requiring zero HTML, the stylesheet utilizes offset conic-gradient() coordinates to render a repeating grid of vertical and horizontal lines. When looking at the resulting pattern, the human visual system automatically completes the missing intersections, perceiving non-existent bright white discs.

Level
Intermediate
Browsers
Chrome 69+ · Edge 79+ · Firefox 83+ · Safari 12.1+
Highlights
Optical Illusion · Conic Gradients · Zero-HTML Layout
Webpage layout featuring a vintage airmail envelope border with diagonal red and blue stripes using CSS gradients
CSS

Retro Airmail Envelope Border

This is a Retro Airmail Envelope Border. It wraps a container with continuous diagonal red and blue stripes. Its function is to provide a nostalgic, thematic framing for content without relying on external raster image assets.

Level
Beginner
Browsers
Chrome 108+ · Edge 108+ · Firefox 101+ · Safari 15.4+
Highlights
Gradient Border · CSS Variables · Vintage Style
Black and white optical illusion geometric pattern generated with pure CSS gradients
CSS

Optical Illusion CSS Background Pattern

This is an Optical Illusion CSS Background Pattern. It generates a complex, interlocking geometric tessellation using only mathematical gradient overlays. Its function is to provide a visually striking, lightweight background texture without requiring external image assets.

Level
Intermediate
Browsers
Chrome 69+ · Edge 79+ · Firefox 83+ · Safari 12.1+
Highlights
Pure CSS · Gradient Overlays · Minimal Footprint
Black and white optical illusion pattern featuring a central circle that appears to pulse against a striped background, created with pure CSS gradients
CSS

Pulsing Circle Optical Illusion

This is a Pulsing Circle Optical Illusion. It generates a static, high-contrast geometric pattern that exploits peripheral vision to create a false sense of motion. Its function is to serve as a lightweight, visually arresting background or artistic centerpiece using only a handful of CSS properties and zero JavaScript.

Level
Beginner
Browsers
Chrome 69+ · Edge 79+ · Firefox 83+ · Safari 12.1+
Highlights
Optical Illusion · Pure CSS · No Animation
Two colored boxes (yellow and blue) moving horizontally across a black and white striped background, demonstrating the stepping feet illusion.
CSS

Stepping Feet Optical Illusion

This is the Stepping Feet Optical Illusion. It demonstrates how high-contrast patterns interfere with human motion perception. Two colored blocks move at identical, constant speeds, yet appear to stagger and “step” like feet. A hover interaction removes the background grid to expose the mathematical reality of their parallel movement.

Level
Intermediate
Browsers
Chrome 105+ · Edge 105+ · Firefox 121+ · Safari 16.4+
Highlights
Pseudo-elements · Keyframe Animation · Linear Gradients
Minimalist dark-mode navigation menu with large serif typography and a background pattern that shifts based on the hovered menu item.
HTML·CSS·JavaScript

Cinematic Parallax Reactive Navigation Menu

This is a Cinematic Parallax Reactive Navigation Menu. It synchronizes large-scale typographical navigation with multi-layered background shifts. Its function is to transform a standard menu into a high-end atmospheric gateway for editorial or premium portfolio websites, using user interaction to drive the visual narrative.

Level
Intermediate
Browsers
Chrome 80+ · Edge 80+ · Firefox 75+ · Safari 13.1+
Highlights
Background Shifting · Parallax Interaction · State-Driven Styling
A UI background starting as white at the top with gray grid lines, fading into a vibrant teal-to-purple gradient at the bottom.
HTML·CSS

Fading Grid Gradient Background

This Fading Grid Gradient Background creates a clean, architectural aesthetic suitable for SaaS landing pages or documentation sites. It features a technical vertical grid pattern that gently dissolves into a vibrant teal-and-purple gradient at the bottom. The effect mimics a “horizon” line, adding depth and structure to an otherwise flat page without using any images.

Level
Beginner
Browsers
Chrome 80+ · Edge 80+ · Firefox 53+ · Safari 15.4+
Highlights
CSS Masks · Stacked Gradients · Pattern Generation · Responsive Background
CSS-Only Pattern: Circles

CSS-Only Pattern: Circles

An elegant, geometrically complex background in blue tones that looks like a vector illustration but weighs only a few bytes and scales easily.

See the Pen CSS-Only Pattern: Circles.

Scalable CSS Radial Gradient Pattern

Scalable CSS Radial Gradient Pattern

A pure CSS pattern created by overlaying five radial-gradient declarations on a single element. The main feature is that all ring sizes and their count depend on a couple of CSS variables, making the pattern fully scalable using calc().

Intersecting Diagonals Pattern

Intersecting Diagonals Pattern

A pattern generated with just one background property, showcasing advanced use of CSS gradients and background-size to create a complex, repeating texture, with flexible customization via custom CSS properties.

CSS-Only Pattern - Waves

CSS-Only Pattern - Waves

A lightweight and effective demo showcasing a complex background pattern created entirely with pure CSS gradients. The result is a dynamic, scalable background without the need for any image files or JavaScript.

See the Pen CSS-Only Pattern - Waves.

Squiggle Waves Tessellated Pattern – Pure CSS

Squiggle Waves Tessellated Pattern – Pure CSS

A complex geometric CSS pattern constructed from multiple layers of conic-gradient and radial-gradient. This seamless background offers a scalable, vector-quality tessellation design that is fully controllable via CSS variables for easy customization.

3D Chocolate Bar Tessellated Pattern – No Div – Pure CSS

3D Chocolate Bar Tessellated Pattern – No Div – Pure CSS

A sophisticated geometric CSS background created with layered conic gradients and custom properties for seamless styling. This performant pattern is fully scalable and provides a lightweight, code-based alternative to images for modern UI/UX design.

Chocolate Wafer CSS Background

Chocolate Wafer CSS Background

A sophisticated striped background pattern built with pure CSS using the linear-gradient hard-stop technique. This lightweight snippet offers a high-performance, responsive UI solution that mimics complex textures without the need for external image assets.

Abstract CSS Pattern

Abstract CSS Pattern

A sophisticated geometric CSS pattern built with layered repeating-conic-gradient to create a complex, seamless background texture. This performant snippet leverages CSS variables for easy customization of scale and color hue, offering a modern and lightweight UI/UX solution.

See the Pen Abstract CSS Pattern.

3D Shadowed Diamonds Tessellated Pattern – Pure CSS, No Divs

3D Shadowed Diamonds Tessellated Pattern – Pure CSS, No Divs

A sophisticated geometric CSS pattern crafted with layered conic gradients and precise hard-stops. This snippet leverages CSS custom properties for effortless scaling and theme customization, providing a high-performance, lightweight background solution with a zero-asset footprint.

Playing with background-blend-mode

Playing with background-blend-mode

Synthetic texture formed by overlaying two distinct gradients. The hard-light combination blends a fine diagonal pattern with a smooth vertical transition, generating a deep, structured background effect without external media assets.

The Half-Rombes Pattern

The Half-Rombes Pattern

The use of the atan() function in SCSS to calculate the angles for a conic-gradient, which allows for the creation of a complex geometric pattern. The entire page background is set with a single background property, demonstrating the power and conciseness of modern CSS.

See the Pen The Half-Rombes Pattern.

Pure CSS Concentric Rings Tessellated Pattern

Pure CSS Concentric Rings Tessellated Pattern

An intricate pure CSS circular pattern built with multi-layered radial gradients and hard-stops defined via custom properties. This technique delivers a seamless, image-free vector texture, ensuring high rendering performance and easy customization for modern web design.

Pure CSS Purple Scales Tessellated Pattern

Pure CSS Purple Scales Tessellated Pattern

A scalable geometric CSS pattern created with layered radial gradients and custom properties for dynamic control over size and color. This lightweight, image-free solution provides a high-performance background ideal for modern and responsive UI/UX design.

Pure CSS Leather Sofa Tessellated Pattern

Pure CSS Leather Sofa Tessellated Pattern

A complex geometric CSS pattern built with layered conic, radial, and linear gradients for a sophisticated tiling effect. This performant snippet leverages CSS variables and the calc() function, providing a lightweight, fully customizable solution for modern and scalable UI design.

Pure CSS Paper Boat Tessellated Pattern

Pure CSS Paper Boat Tessellated Pattern

An intricate geometric pattern built with layered conic gradients and modern CSS custom properties. This snippet showcases a seamless tiling technique that provides a scalable, vector-quality background, ensuring high frontend performance and easy customization.

Pure CSS Reptile Scales Tessellated Pattern

Pure CSS Reptile Scales Tessellated Pattern

A complex geometric CSS pattern built with layered conic, radial, and linear gradients for a sophisticated tiling effect. This performant snippet leverages CSS variables and the calc() function, providing a lightweight, fully customizable solution for modern and scalable UI design.

CSS Only Intersecting Wavy Pattern

CSS Only Intersecting Wavy Pattern

A high-performance radial gradient CSS pattern that creates complex concentric visual effects with minimal code. This lightweight, image-free background is fully customizable via CSS variables, making it perfect for modern and scalable web projects.

Pure CSS Cactus Texture Tessellated Pattern

Pure CSS Cactus Texture Tessellated Pattern

Twenty-plus stacked repeating-conic-gradient layers on a single background property, plus a linear-gradient base — all tiling at 100px × 100px. Gradients are clipped to narrow angle arcs (2deg–31deg), creating leaf-like shapes that repeat across the viewport. A subtle blur and contrast filter ties the layers together into a tessellated cactus landscape texture. Zero elements, zero JS.

Pure CSS Weave Quilt Tessellated Pattern

Pure CSS Weave Quilt Tessellated Pattern

A woven quilt texture built from conic gradients positioned at incremental vertical offsets (50% through 90%), creating diamond-shaped weave intersections. Three purple tones cycle through a repeating-linear-gradient base. “Hide” layers mask the top and bottom halves so only the interlocking center section is visible. Zero elements, pure background math.

CSS-only Oval Pattern

CSS-only Oval Pattern

A tileable pattern of nested oval shapes built from conic gradients at precise positions — 25%, 50%, and 75% — creating interlocking blue and orange curved forms. Thin grid lines separate each 160×80px tile. A horizontal linear gradient splits the base into blue top, orange bottom. Zero HTML elements, pure background composition.

See the Pen CSS-only Oval Pattern.

Pure CSS 3D Wavy Rect Lines Tessellated Pattern

Pure CSS 3D Wavy Rect Lines Tessellated Pattern

Conic gradients positioned at 25%, 50%, and 75% of each 160×80px tile create nested rectangular arcs in alternating blue and orange. A horizontal linear grid overlay adds 1px separator lines. The base blue-to-orange gradient fills the background. The result looks like a 3D wavy rectilinear pattern — zero HTML, pure background layering.

Pure CSS Pattern

Pure CSS Pattern

Three gradients stacked on <html>: a repeating-conic checkerboard (12em), a diagonal linear gradient (6em), and a radial gradient of concentric rings with a grey stroke (6em). Combined via difference and overlay blend modes, they produce a connector-like grid of interlocking circles. Ana Tudor’s signature minimal-gradient approach.

See the Pen Pure CSS Pattern.

A Strange CSS Only Pattern

A Strange CSS Only Pattern

Two conic gradients, same color stops (peach, brown, transparent), different angles and sizes. A base 50px tile with from 180deg sits under a 150px repeating layer with from 90deg. The mismatch between the two grids creates an unexpected moiré-like geometric pattern. Temani Afif’s signature — minimal code, surprising output.

See the Pen A Strange CSS Only Pattern.

They Are Looking at You!

They Are Looking at You!

A 100px tile of three radial gradients. Two opposing corner gradients — top-right and bottom-left — use alternating red and dark-red bands to form curved pupil-like shapes. A small centered circle completes each “eye”. The result is a grid of staring faces. Temani Afif at his most playful.

See the Pen They Are Looking at You!.

CSS Only Circular Pattern

CSS Only Circular Pattern

A 100px tile of radial-gradient circles — transparent center, brown ring, green-yellow outer — laid over a 200px diagonal repeating-linear-grid in the same colors. The rings sit at each tile corner, creating a polka-dot grid with a woven diagonal backdrop. Two layers, two gradients.

See the Pen CSS Only Circular Pattern.

Folded Zig Zag Pattern

Folded Zig Zag Pattern

Four conic gradients at from -30deg, each with a 240deg arc of a different color — white, green, transparent, dark blue — tiling at 126×84px. A semi-transparent black linear gradient overlays the bottom half, adding a folded shadow effect. The alternating diagonal segments create a continuous zigzag ribbon. Four layers, one tile.

See the Pen Folded Zig Zag Pattern.

A Zig Zag 3D CSS-Only Pattern

A Zig Zag 3D CSS-Only Pattern

Five conic gradients with precise fractional positions (250%/3, 50%/3, 200%/3, etc.) create a repeating 3D zigzag tile in black, grey, and white. The pattern uses tan(30deg) for hexagonal geometry calculations, with a @supports fallback for older browsers. Multiple staggered copies of each gradient layer produce an isometric folded ribbon effect.

Pure CSS Circles & Lines Tessellated Pattern

Pure CSS Circles & Lines Tessellated Pattern

Twenty-two radial and linear gradient layers on a 160×160px tile in two purples. Corner and edge circles at varying sizes (7%, 8%, 13%) form a dotted border. Diagonal crosses, a center circle, and 4%-thick horizontal/vertical lines weave into a concentric geometric ornament. Zero HTML, pure background stacking.

Pure CSS 3D Extruded Tetris T Pieces Tessellated Pattern

Pure CSS 3D Extruded Tetris T Pieces Tessellated Pattern

Four conic gradients at precise fractional positions (66.66%, 33.33%, 83.335%, 16.665%) tile at 105×122px to form isometric Tetris T-shapes in four greens. Each gradient covers specific 60-120° arcs, creating the 3D extruded faces — top, sides, and shadow. A single tiled background, zero HTML, pure geometric conic layering.

Pure CSS 3D Floating Cubes Tessellated Pattern

Pure CSS 3D Floating Cubes Tessellated Pattern

Eighteen conic gradients tile at 188×108px to render isometric floating cubes in four grey-blue tones. Each cube face is a separate conic layer at a specific 60-120° arc — top, front, side, and shadow planes. Gradients are duplicated to prevent edge bleeding at tile boundaries. Pure CSS, zero HTML, meticulous fractional positioning.

Pure CSS 3D Interspersed Cuboids Tessellated Pattern

Pure CSS 3D Interspersed Cuboids Tessellated Pattern

Six conic gradients tile at 70×246px to form isometric 3D cuboids in three greens. The same set of gradients is duplicated — one copy offset by half the tile dimensions, creating an interspersed staggered layout. Each cuboid face uses specific 35-180° arcs for top, sides, and depth. Pure CSS, dual background trick, no HTML.

Blue and Purple Knitting

Blue and Purple Knitting

A knitted chevron textile pattern built from four conic gradients and two repeating-linear gradients. Conic layers at fractional positions (100%/6, 500%/6) form interlocking purple V-shapes. Diagonal linear stripes — purple and blue — create the woven background. The 0.866 multiplier in tile dimensions comes from sin(60°), hinting at an underlying hexagonal grid. Zero HTML, six backgrounds.

See the Pen Blue and Purple Knitting.

Pure CSS 3D ZigZagged ZigZag Tessellated Pattern

Pure CSS 3D ZigZagged ZigZag Tessellated Pattern

Eleven conic gradients tile at 198×168px to build a 3D zigzag landscape in purple and violet tones. Gradients are placed at decreasing left-edge positions (100% → 15%) with precise arc angles (84–217°), forming overlapping folded planes. The result simulates staggered geometric terrain with depth — no HTML, pure conic layering.

Pure CSS Police Line Tessellated Pattern

Pure CSS Police Line Tessellated Pattern

A yellow-and-black hazard barricade pattern on a 105×210px tile. Four conic gradients create the interlocking jagged stripes — two yellow, one amber, one black — while a diagonal linear gradient slices the tile into alternating color blocks. A semi-transparent overlay adds a subtle top shadow. Fits the “police line” visual trope with zero elements.

Another CSS Pattern

Another CSS Pattern

A checkerboard-like pattern of rounded diamond shapes in beige and silver on a dark charcoal ground. Two conic gradients — one beige, one grey — share the same at 45% 40%, #0000 75% clip. Four copies offset across a 200×100px tile create a staggered grid. Six lines of meaningful CSS.

See the Pen Another CSS Pattern.

Pure CSS Rain Curtain Tessellated Pattern

Pure CSS Rain Curtain Tessellated Pattern

A complex geometric background implemented in pure CSS using layered radial and conic gradients. By leveraging CSS variables, this pattern is easily scalable and customizable for any color scheme in modern web UI designs.

Pure CSS Roof Tile Tessellated Pattern

Pure CSS Roof Tile Tessellated Pattern

Nineteen background layers — radial gradients for rounded tile tops, conic gradients for overlapping edges, and a linear bottom strip — tile at 100×240px. The entire set is duplicated with a half-size offset to create staggered roof tiles in terracotta tones with dark shadows. Zero HTML, pure background stacking with dual-position trick.

Arrow CSS Patterns

Arrow CSS Patterns

A repeating arrow/chevron pattern in red and dark purple. Two conic gradients at opposite corners (75%/75% and 25%/25%) each quarter-fill with alternating colors, creating directional V-shapes. A repeating-conic base fills the gaps.

See the Pen Arrow CSS Patterns.

CSS Repeating Tangled Background

CSS Repeating Tangled Background

33 layered linear gradients on a single #tangled div, all tiling at 12em. Each gradient uses 4-5 narrow color stops (transparent → navy → white → navy → transparent) at varied angles — 5°, 7°, 30°, 70°, 80°, 100°, 110°, 115°, 119°, 127°, 130°, 131°, 133°, 140°, 170°. The result is a dense, hand-crafted tangle of intersecting navy-and-white ribbons on a powder-blue ground. Zero JS, just painstakingly tuned percentages.

Wavy Dotted Pattern

Wavy Dotted Pattern

Four backgrounds on <html>: radial gradients at 37.5% create green wavy arcs with clipped 39-94% color stops, offset copies fill the grid. A small radial dot layer and a repeating-conic checkerboard in red-brown and dark grey form the base. The 160×120px tile combines curvilinear waves with rigid geometric blocks.

See the Pen Wavy Dotted Pattern.

Another CSS Pattern

Another CSS Pattern

A 90px tile built from a radial-gradient ring (yellow inside, dark pink outside) and four conic corner pieces at 18.75% offset — each filling a quarter-circle in dark pink.

See the Pen Another CSS Pattern.

Halftone Variations

Halftone Variations

Six pattern variations and three map variations, all built from CSS custom properties.

See the Pen Halftone Variations.

Pure CSS 3D Mini Cubes Tessellated Pattern

Pure CSS 3D Mini Cubes Tessellated Pattern

Thirteen background layers tile at 265×234px to render isometric mini cubes in a blue-grey palette. Six conic gradients carve the 3D faces — top, sides, bottom, and diagonal slices — at precise fractional positions (24.5%, 49.5%, 50%, 74.5%). Two repeating-conic noise layers add surface grain. Linear gradients define edges and shadows. Zero HTML, pure CSS geometry.

Another CSS Pattern

Another CSS Pattern

A scalloped tile pattern in red-brown and dark grey. Two radial gradients at opposite corners (30%/bottom and 70%/top) use clipped 67–98% color stops to form curved arcs — like overlapping semi-circles. A repeating-linear stripe base fills the 160×96px tile.

See the Pen Another CSS Pattern.

Another CSS Pattern

Another CSS Pattern

A staggered scalloped tile pattern in orange and teal. A single radial gradient with clipped 67–98% color stops creates curved arcs, duplicated with a half-tile offset (80×48px) to form overlapping semi-circles. A repeating-linear stripe base fills the 160×96px tile.

See the Pen Another CSS Pattern.

Pure CSS 3D Vertical Blocks Tessellated Pattern

Pure CSS 3D Vertical Blocks Tessellated Pattern

Fifteen conic gradients tile at 154×266px to form isometric vertical blocks in four greens. Two reusable gradient variables (--b1, --b2) are each duplicated four times at offset positions. Conic arcs at 60-180° carve the 3D planes — top faces, front sides, and recessed shadows. A central gradient ties the column together. Zero HTML, pure conic geometry.

Another CSS Pattern

Another CSS Pattern

A diagonal plaid pattern in dark grey and terracotta on a 100px tile. A linear-gradient(135deg) creates a diagonal dark stripe across the tile (20–30% fill). A repeating-linear-gradient(45deg) adds alternating dark grey and terracotta bands.

See the Pen Another CSS Pattern.

Another CSS Pattern

Another CSS Pattern

A diagonal grid of green diamonds on a dark teal ground. A linear-gradient(45deg) creates the large diamond frames (10–40% fill). Two repeating-linear-gradient layers — at ±45° — produce the small internal grid using a custom variable --g with teal bands at -5% to 5%. The result is a woven bamboo-like pattern.

See the Pen Another CSS Pattern.

CSS Upholstery Pattern

CSS Upholstery Pattern

Ten layered backgrounds on a 100×100px tile recreate a dark diamond-buttoned upholstery texture. Radial gradients form quilted bumps at staggered positions, diagonal linear gradients create the seam creases, and darker overlays add shadow depth.

See the Pen CSS Upholstery Pattern.

Another CSS Pattern

Another CSS Pattern

A conic gradient at 90% 40% clips a quarter-circle in brown — duplicated at 50px 50px offset on a beige ground. The two copies tile at 100×100px, creating a four-leaf clover pattern where the brown arcs meet at the center.

See the Pen Another CSS Pattern.

Another CSS Pattern

Another CSS Pattern

Four radial gradients at the four corners of a 138×115px tile — top-left, top-right, bottom-left, bottom-right — each drawing a quarter-circle in deep pink on a light blue ground. The corner circles overlap at the tile center, creating a four-petal flower-like shape.

See the Pen Another CSS Pattern.

CSS Radial Pattern With Subtle Animation

CSS Radial Pattern With Subtle Animation

A 100px tile of two offset radial gradients — each creating concentric rings in yellow, dark blue, and teal with precise %-stop bands (43-83%). The second copy is shifted by 50px for a staggered effect. A ::before overlay fades the dark blue background in and out on a 4s infinite loop, giving the pattern a subtle pulsing depth. CSS only, one div.

CSS Irregular Stripes Background (Cicada Principle)

CSS Irregular Stripes Background (Cicada Principle)

Three vertical linear-gradient stripes — red, blue, dark blue — each with a different width (7px, 23px, 23px) and tiled at three distinct background-size values (43px, 61px, 89px). Since 43, 61, and 89 are prime, their periods never align — producing an irregular, pseudo-random stripe pattern. The Cicada Principle in 8 lines of CSS.

CSS-Only Pattern: Flowers

CSS-Only Pattern: Flowers

A floral tile pattern built from 22 radial-gradient circles on a 220×220px grid. Four groups form a flower: group one (center petal ring), group two (dark corner petals), groups three and four (outer accent dots). A larger central circle in cream ties the composition. Clicking swaps the palette — 8 color schemes cycle via JS. Pure CSS pattern with a palette picker.

See the Pen CSS-Only Pattern: Flowers.

Pure CSS Background Pattern

A dotted grid with diagonal crosshairs — three backgrounds on body. A conic gradient at 1px 1px tiles 1em dots. Two orthogonal linear gradients (±45°) with subpixel 0.5px strokes create thin diagonal lines crossing at each grid intersection. The result is a precise drafting-paper blueprint texture.

Knowledge Base

Frequently Asked Questions

Common questions about integration, browser support, and customizing these components.

Why use CSS gradient patterns instead of SVG or image-based backgrounds?
CSS gradient patterns require zero HTTP requests and scale vectorially across all resolutions without file-size overhead. Unlike raster images, they adapt to container dimensions automatically and can be themed in real-time using CSS Custom Properties without reloading assets.
How do gradient-based background patterns affect rendering performance?
Gradient patterns are rasterized by the browser’s rendering engine as bitmap textures, so layering too many stops per gradient or stacking more than 4–5 gradient layers can increase paint time. For complex textures, consider using the CSS Paint API (Houdini) to offload pattern generation to a dedicated worklet thread.
How can I make background patterns responsive without media queries?
Use relative units like % or vw in background-size combined with CSS Container Queries to scale the pattern unit proportionally to the parent container. This ensures seamless pattern density across viewports without hardcoded breakpoints.
How to maintain sufficient color contrast when placing content over patterned backgrounds?
Always define a solid background-color fallback behind the gradient pattern to guarantee readability. Use the contrast-color() function or OKLCH color space to programmatically adjust text color against the dominant pattern hue.
What is the best fallback strategy for browsers that don’t support advanced gradient syntax?
Layer a fully opaque background-color as the first declaration, then override it with the gradient pattern. Browsers that ignore the gradient will display the solid color, ensuring content remains readable without feature detection overhead.
Can CSS gradient patterns be animated efficiently without causing layout thrash?
Yes — animate gradients by transitioning CSS Custom Properties registered with @property, which bypasses main-thread repaints. Avoid animating background-size or background-position directly, as these trigger layout recalculations on every frame.