Skip to content

Instantly share code, notes, and snippets.

@DavidWells
Created September 25, 2015 18:23
Show Gist options
  • Star 3 You must be signed in to star a gist
  • Fork 1 You must be signed in to fork a gist
  • Save DavidWells/1f977cc310feb1264b41 to your computer and use it in GitHub Desktop.
Save DavidWells/1f977cc310feb1264b41 to your computer and use it in GitHub Desktop.
Example of how to use keyframes in webpack with css-loader + postcss
:global {
.test {
position: absolute;
width:30px;
height:30px;
background: red;
display: block;
left:0px;
&:hover{
transform: rotateY(0deg);
animation: expand 1s ease-in-out forwards;
}
}
}
/* correct keyframe syntax */
@keyframes :global(expand) {
0% {
width: 10px;
left:0px;
}
25% {
left:25%;
}
50% {
left:50%;
}
100% {
width: 30px;
left:100%;
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment