@roadtrip/css
Version:
CSS framework for Roadtrip Design System
87 lines (68 loc) • 1.18 kB
CSS
/*
* Spinner
*
* Index
* - Spinner
* - Spinner circle
* - Spinner animation
*
*/
/* SPINNER
-------------------- */
.spinner{
transform-origin: center;
animation: road-rotate 2s linear infinite;
}
.spinner.spinner--small{
width: 1rem;
height: 1rem;
}
.spinner.spinner--medium{
width: 2rem;
height: 2rem;
}
.spinner.spinner--large {
width: 3rem;
height: 3rem;
}
.spinner.spinner--xl {
width: 8rem;
height: 8rem;
}
/* SPINNER CIRCLE
-------------------- */
.spinner-circle {
animation: road-dash 1.5s ease-in-out infinite;
fill: none;
stroke: var(--road-primary);
stroke-width: 3;
stroke-dasharray: 1, 200;
stroke-dashoffset: 0;
stroke-linecap: round;
}
.spinner-circle.spinner-circle--dark {
stroke: var(--road-grey-0);
}
.spinner-circle.spinner-circle--light {
stroke: var(--road-grey-90);
}
/* SPINNER ANIMATION
-------------------- */
@keyframes road-rotate {
100% {
transform: rotate(360deg);
}
}
@keyframes road-dash {
0% {
stroke-dasharray: 1, 200;
stroke-dashoffset: 0;
}
50% {
stroke-dasharray: 90, 200;
stroke-dashoffset: -35px;
}
100% {
stroke-dashoffset: -125px;
}
}