Two opposing arcs spin around an invisible track. A slightly more energetic take on the ring spinner that still needs only a single element.
<div class="ldr-dual-ring" role="status" aria-label="Loading"></div>
.ldr-dual-ring {
--s: var(--ldr-size, 48px);
--c: var(--ldr-color, #3b82f6);
width: var(--s);
height: var(--s);
border: calc(var(--s) / 10) solid transparent;
border-top-color: var(--c);
border-bottom-color: var(--c);
border-radius: 50%;
animation: ldr-dual-ring-spin 1s linear infinite;
}
@keyframes ldr-dual-ring-spin {
to { transform: rotate(360deg); }
}
@media (prefers-reduced-motion: reduce) {
.ldr-dual-ring, .ldr-dual-ring *, .ldr-dual-ring::before, .ldr-dual-ring::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.