Skip to content

Instantly share code, notes, and snippets.

@knowbody
Created April 6, 2017 12:23
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save knowbody/180bec8592672d772a5ddd6a666fef66 to your computer and use it in GitHub Desktop.
Save knowbody/180bec8592672d772a5ddd6a666fef66 to your computer and use it in GitHub Desktop.
Styled Spinner
import styled from 'styled-components';
const StyledSpinner = styled.svg`
animation: rotate 2s linear infinite;
margin: -25px 0 0 -25px;
width: 50px;
height: 50px;
& .path {
stroke: #5652BF;
stroke-linecap: round;
animation: dash 1.5s ease-in-out infinite;
}
@keyframes rotate {
100% {
transform: rotate(360deg);
}
}
@keyframes dash {
0% {
stroke-dasharray: 1, 150;
stroke-dashoffset: 0;
}
50% {
stroke-dasharray: 90, 150;
stroke-dashoffset: -35;
}
100% {
stroke-dasharray: 90, 150;
stroke-dashoffset: -124;
}
}
`;
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment