The aurora is a background for hero cards and call-to-action blocks: a near-black surface where soft colored light bleeds in from the edges, finished with a layer of film grain. It is built with plain CSS gradients, so it weighs zero bytes of image, scales to any size and uses the same color variables as the rest of the theme.
It is meant to be used sparingly. One aurora per page, usually in a closing call to action or in the hero, is enough to give the site a focal point without competing with the content.
Live demo
Move the sliders to see how each parameter changes the result.
The demo is self-contained: it carries its own copy of the CSS (with hex fallbacks, so it also works on a page that does not load the theme) and a small script for the sliders. Once the aurora lives in the brand stylesheet, the <style> block can be removed from this page.
Anatomy
The effect is made of three stacked layers. Understanding them makes it easy to tune.
- Base. A solid
dark-1background on the element itself. Everything else paints on top of it. - Light leaks. A
::beforepseudo-element, larger than the card, holding several elliptical radial gradients plus one diagonal linear gradient for the streak. The whole layer is blurred, which turns the hard-edged gradients into soft glows. - Grain. An
::afterpseudo-element with an SVG noise filter, blended withoverlay. It breaks the perfectly smooth gradients, which is what makes the result look photographic instead of digital.
The grain deserves a closer look, because it is the only part that is not a gradient. The feTurbulence filter generates fractal noise, a random-looking pattern similar to the texture of a photograph. It is drawn once on a 200×200 SVG tile, and the browser repeats that tile across the card (stitchTiles='stitch' makes the edges match, so the repetition is invisible). The SVG is embedded as a data URI instead of a separate file to save a request, and %23n is just #n URL-encoded, which is how the rectangle refers to the filter with id='n'. The strength is not part of the SVG: --aurora-grain controls it through the opacity of the pseudo-element.
The element uses isolation: isolate so the pseudo-elements can sit behind the content (z-index: -1 and -2) without escaping the card.
Usage
Add the class to any container. Content goes inside as usual:
<section class="aurora">
<h2>Start saving time. Start scaling faster.</h2>
<p>Let's identify where automation can make the biggest impact.</p>
<a class="button" href="/contact">Book a free call</a>
</section>
The container needs some padding and a fixed or minimum height to show enough surface. Something around min-height: 24rem and padding: 4rem 2rem works well for a call to action.
The CSS
.aurora {
/* tunable parameters */
--aurora-base: var(--polar-dark-1);
--aurora-color-1: var(--polar-glacier-2);
--aurora-color-2: var(--polar-accent-orange);
--aurora-color-3: var(--polar-glacier-3);
--aurora-streak: var(--polar-glacier-1);
--aurora-blur: 40px;
--aurora-intensity: 0.7;
--aurora-grain: 0.15;
position: relative;
overflow: hidden;
isolation: isolate;
border-radius: 3rem;
background: var(--aurora-base);
color: var(--polar-mist-3);
}
/* light leaks */
.aurora::before {
content: "";
position: absolute;
inset: -20%;
z-index: -2;
background:
linear-gradient(115deg, transparent 35%, var(--aurora-streak) 48%, transparent 60%),
radial-gradient(ellipse 30% 45% at 25% 5%, var(--aurora-color-1), transparent 70%),
radial-gradient(ellipse 26% 38% at 59% 20%, var(--aurora-color-2), transparent 70%),
radial-gradient(ellipse 25% 40% at 100% 10%, var(--aurora-color-3), transparent 70%),
radial-gradient(ellipse 25% 50% at 0% 85%, var(--aurora-color-3), transparent 70%);
filter: blur(var(--aurora-blur));
opacity: var(--aurora-intensity);
}
/* film grain */
.aurora::after {
content: "";
position: absolute;
inset: 0;
z-index: -1;
background-image: url("data:image/svg+xml;utf8,<svg xmlns='http://www.w3.org/2000/svg' width='200' height='200'><filter id='n'><feTurbulence type='fractalNoise' baseFrequency='0.8' numOctaves='3' stitchTiles='stitch'/></filter><rect width='100%' height='100%' filter='url(%23n)'/></svg>");
opacity: var(--aurora-grain);
mix-blend-mode: overlay;
}
Parameters
Every value that is worth changing is a custom property on the element, so a variant never needs to touch the selectors above.
| Property | Default | What it does |
--aurora-base | dark-1 | Color of the surface behind the glows. |
--aurora-color-1 | glacier-2 | Glow in the top left, the coldest and brightest one. |
--aurora-color-2 | accent-orange | Warm glow at the top. It is the point of contrast, so keep it small. |
--aurora-color-3 | glacier-3 | Deep blue used in two corners to frame the card. |
--aurora-streak | glacier-1 | Diagonal streak that imitates a lens flare. |
--aurora-blur | 40px | How soft the glows are. Higher values look smoother and more atmospheric. |
--aurora-intensity | 0.7 | Overall strength of the glows. |
--aurora-grain | 0.15 | Strength of the film grain. Set it to 0 to remove it. |
.aurora-cold {
--aurora-color-2: var(--polar-glacier-1);
}
Tuning it
The gradient positions are percentages of the pseudo-element, which is 40% larger than the card because of inset: -20%. This is the most common source of confusion: a glow placed at 0% does not sit on the edge of the card, it sits 20% of the card outside of it, and most of it is cropped by overflow: hidden.
To place a glow at a given point of the card, convert it with (card position + 20) / 1.4. For example, a glow that should be centered at 60% of the width and 15% of the height of the card goes at at 57% 25%. The same factor applies to sizes: a radius of 30% of the pseudo-element is about 42% of the card.
A few more rules of thumb:
- Move a glow by changing the
at X% Y%part of its gradient. Placing it partly outside of the card is fine and gives a natural look, but if a glow seems to be missing, check first that its center is not too far out. - Change a glow's size with the first two numbers (
ellipse 30% 45%), which are its horizontal and vertical radius. Tall and narrow ellipses read as beams of light, wide and flat ones as haze. - Make the streak more or less visible by narrowing or widening its color stop range (
35%to60%) and by changing its angle (115deg). - Keep the center dark. Text sits in the middle of the card, so leave that area to the base color and let the glows live near the edges.
Accessibility
Text on the aurora is mist-3 on dark-1, a contrast of 14.58:1, which is well above AAA. That number only holds where the surface is actually dark, though. A glow that drifts behind the text can lower the contrast a lot, since glacier and orange are mid-tones. Keep the glows away from the area where copy sits, and check the final result with real text on top before shipping.
The effect is fully static, so there is nothing to disable for users who prefer reduced motion.
Limitations and alternatives
CSS gradients can imitate the glow and the grain, but not optical effects such as the colored fringes of a real lens flare, where the light splits into a faint rainbow along its edge. In CSS that area stays flat.
Two other ways of getting the same background, in case you need them:
- A pre-rendered image. Export the effect as WebP or AVIF and use it as
background-image. It looks exactly as designed and, because it is mostly blur, it compresses well. The cost is that it no longer follows the theme: a different palette or dark mode variant means another image. - A shader. A WebGL or canvas shader can render the same look and animate it. It is the most flexible option and also the heaviest, so it only makes sense if the movement is part of the design.
For most uses the CSS version is the best trade-off, and it is the one kept in the design system.
Performance
Blur filters on large elements are cheap when static, but expensive if you animate them or repaint the card often. Keep the aurora static, avoid placing it inside elements that scroll with heavy transforms, and do not stack several on the same screen.