A glowing sun whose soft rays turn slowly and flare in time with the core. The rays are one repeating conic gradient faded by a radial mask; spin and flare use separate rotate and scale.
Also known as: sun rays animation, starburst spinner, rotating rays css.
<div class="ldr-sunburst" role="status" aria-label="Loading"></div>
.ldr-sunburst {
--s: var(--ldr-size, 48px);
--c: var(--ldr-color, #3b82f6);
position: relative;
width: var(--s);
height: var(--s);
}
.ldr-sunburst::before,
.ldr-sunburst::after {
content: "";
position: absolute;
border-radius: 50%;
animation: ldr-sunburst-flare 2.4s ease-in-out infinite;
}
.ldr-sunburst::before {
inset: -14%;
background: repeating-conic-gradient(from -4deg, var(--c) 0 7deg, transparent 9deg 28deg, var(--c) 30deg);
-webkit-mask: radial-gradient(closest-side, transparent 36%, #000 44%, transparent 100%);
mask: radial-gradient(closest-side, transparent 36%, #000 44%, transparent 100%);
animation: ldr-sunburst-spin 8s linear infinite, ldr-sunburst-flare 2.4s ease-in-out infinite;
}
.ldr-sunburst::after {
inset: 29%;
background: radial-gradient(circle at 38% 34%, color-mix(in srgb, var(--c) 35%, #fff), var(--c) 70%);
box-shadow: 0 0 calc(var(--s) / 5) color-mix(in srgb, var(--ldr-color, #3b82f6) 70%, transparent);
}
@keyframes ldr-sunburst-spin {
to { rotate: 360deg; }
}
@keyframes ldr-sunburst-flare {
0%, 100% { scale: 0.9; }
50% { scale: 1.06; }
}
@media (prefers-reduced-motion: reduce) {
.ldr-sunburst, .ldr-sunburst *, .ldr-sunburst::before, .ldr-sunburst::after, .ldr-sunburst *::before, .ldr-sunburst *::after {
animation-duration: 3s;
}
}--ldr-color on the element or a parent.
Currently previewing #3b82f6.--ldr-size. Every dimension in the snippet is
derived from it. Currently previewing 64px.animation shorthand.
Delays on the children are relative, so they keep their rhythm.role="status" and an
aria-label so screen readers announce the wait. The reduced-motion rule
at the end slows the animation for users who asked for less motion.