A soft pastel aurora rises behind the top edge of a white page, its colors slowly circling the rim like light through frosted glass. A blurred conic gradient turns on a registered @property angle.
Also known as: soft aurora background light, aurora gradient light mode, pastel aurora hero css.
<div class="bgx-aurora-glow-light" aria-hidden="true"><span class="bgx-aurora-glow-light-halo"></span></div>
@property --bgx-aurora-glow-light-a {
syntax: "<angle>";
inherits: false;
initial-value: 0deg;
}
.bgx-aurora-glow-light {
--c: var(--bgx-color, #3b82f6);
font-size: var(--bgx-size, 16px);
position: absolute;
inset: 0;
overflow: hidden;
background: oklch(from var(--c) 0.99 0.005 calc(h + 0));
isolation: isolate;}
.bgx-aurora-glow-light-halo {
position: absolute;
left: 50%;
top: -58%;
width: max(120%, 36em);
height: 110%;
translate: -50% 0;
border-radius: 50%;
background: conic-gradient(from var(--bgx-aurora-glow-light-a), oklch(from var(--c) 0.8 0.13 calc(h + 0)), oklch(from var(--c) 0.88 0.1 calc(h + 70)), oklch(from var(--c) 0.84 0.12 calc(h + 150)), oklch(from var(--c) 0.9 0.07 calc(h - 60)), oklch(from var(--c) 0.78 0.15 calc(h - 20)), oklch(from var(--c) 0.8 0.13 calc(h + 0)));
filter: blur(3em);
opacity: 0.85;
animation:
bgx-aurora-glow-light-turn 14s linear infinite,
bgx-aurora-glow-light-breathe 7s cubic-bezier(0.45, 0, 0.55, 1) infinite alternate;
}
.bgx-aurora-glow-light::after {
content: "";
position: absolute;
inset: 0;
background: linear-gradient(transparent 40%, oklch(from var(--c) 0.99 0.005 calc(h + 0)) 92%);
}
@keyframes bgx-aurora-glow-light-turn {
to { --bgx-aurora-glow-light-a: 360deg; }
}
@keyframes bgx-aurora-glow-light-breathe {
from { transform: scale(0.94, 0.9); }
to { transform: scale(1.04, 1.06); }
}
@media (prefers-reduced-motion: reduce) {
.bgx-aurora-glow-light, .bgx-aurora-glow-light::before, .bgx-aurora-glow-light::after, .bgx-aurora-glow-light *, .bgx-aurora-glow-light *::before, .bgx-aurora-glow-light *::after { animation-play-state: paused; }
}
@media (prefers-reduced-motion: reduce) {
.bgx-aurora-glow-light, .bgx-aurora-glow-light *, .bgx-aurora-glow-light::before, .bgx-aurora-glow-light::after, .bgx-aurora-glow-light *::before, .bgx-aurora-glow-light *::after {
animation-duration: 0.01ms !important;
animation-iteration-count: 1 !important;
transition-duration: 0.01ms !important;
}
}--bgx-color on the element or a parent.
Currently previewing #3b82f6.--bgx-size. Every other dimension is in
em, so the whole thing scales together. Currently previewing 16px.transition or animation
shorthand. Staggered delays are relative, so they keep their rhythm.