Backdrop
A container that draws a decorative pattern behind its content: dots, a grid, stripes, flicker, aurora or meteors.
c2-backdrop wraps a hero, a landing section or an empty state and draws a decorative background behind it. The content stays in normal flow above the pattern; the pattern is hidden from assistive technology and never takes the pointer.
Import
import '@c2n/components/backdrop'Usage
Dots
A quiet texture
Dots
A quiet texture
Grid
A blueprint feel
Grid
A blueprint feel
Flicker
Squares light up and fade
Flicker
Squares light up and fade
Aurora
Slow drifting colour
Aurora
Slow drifting colour
Meteors
Streaks cross now and then
Meteors
Streaks cross now and then
Patterns
dots, grid and stripes are still, drawn with CSS gradients. flicker lights squares of a fine grid at random on a canvas, aurora drifts three soft blobs of colour, and meteors sends --c2-backdrop__meteor--count streaks across. A moving pattern stops while it is off screen or the page is hidden, and stays still under reduced motion.
Styling
--c2-backdrop--color and --c2-backdrop--size set the dots’, lines’ and squares’ colour and spacing; the default grey reads in both themes. --c2-backdrop__mask--image fades the pattern (toward the edges by default; none keeps it even, a linear gradient fades it one way). The aurora’s three colours, opacity, blur and drift time, the flicker colour and the meteors’ colour and length are variables too, and --c2-backdrop--padding spaces the content.