Skip to content

Instantly share code, notes, and snippets.

@Swiip
Created May 17, 2018 09:23
Show Gist options
  • Save Swiip/18a2b219def761533a82218dbbc0b676 to your computer and use it in GitHub Desktop.
Save Swiip/18a2b219def761533a82218dbbc0b676 to your computer and use it in GitHub Desktop.
import styled, { keyframes } from "styled-components";
const spin = keyframes`
0 { transform: rotate(0deg) translateZ(0); }
100% { transform: rotate(-360deg) translateZ(0); }
`;
const BB8 = styled.div`
&:before {
animation: ${({ turn }) =>
turn ? `${spin} 0.8s infinite linear` : "none"};
}
`;
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment