Skip to content

Instantly share code, notes, and snippets.

@alexvcasillas
Created September 4, 2017 11:53
Show Gist options
  • Save alexvcasillas/7f7a5ce482cb2412d389395cd50f8f0c to your computer and use it in GitHub Desktop.
Save alexvcasillas/7f7a5ce482cb2412d389395cd50f8f0c to your computer and use it in GitHub Desktop.
styled-components-iterate
const Wrapper = styled.div`
display: inline-block;
animation-duration: ${({ duration }) => (duration ? `${duration}s` : '1s')};
animation-name: ${({ animation }) =>
animation ? animation : 'no-animation'};
animation-fill-mode: forwards;
animation-iteration-count: ${({ iteration }) =>
iteration ? iteration : '1'};
&:hover {
${({ hoverTransitions }) =>
hoverTransitions.forEach(transition => transition)}};
}
&:focus {
}
&:active {
}
`;
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment