.spinner { display: inline-block; position: relative; --size: 20px; --dot-size: 3px; width: var(--size); height: var(--size); } .size-small { --size: 20px; } .size-medium { --size: 30px; --dot-size: 5px; } .size-large { --size: 40px; --dot-size: 6px; } .spinner .dot { transform-origin: calc(var(--size) / 2) calc(var(--size) / 2); animation: spinnerAnimation 0.8s linear infinite; } .spinner .dot::after { content: ' '; display: block; position: absolute; top: calc(var(--dot-size) / 2); left: var(--dot-size); width: var(--dot-size); height: var(--dot-size); border-radius: 50%; background-color: currentColor; } .accent .dot::after { background-color: var(--Icon-Interactive-Default); } .inverted .dot::after { background-color: var(--Icon-Inverted); } .dot:nth-child(1) { transform: rotate(0deg); animation-delay: -0.7s; } .dot:nth-child(2) { transform: rotate(45deg); animation-delay: -0.6s; } .dot:nth-child(3) { transform: rotate(90deg); animation-delay: -0.5s; } .dot:nth-child(4) { transform: rotate(135deg); animation-delay: -0.4s; } .dot:nth-child(5) { transform: rotate(180deg); animation-delay: -0.3s; } .dot:nth-child(6) { transform: rotate(225deg); animation-delay: -0.2s; } .dot:nth-child(7) { transform: rotate(270deg); animation-delay: -0.1s; } .dot:nth-child(8) { transform: rotate(315deg); animation-delay: 0s; } @keyframes spinnerAnimation { 0% { opacity: 1; } 100% { opacity: 0; } }