Skip to content

Instantly share code, notes, and snippets.

Show Gist options
  • Select an option

  • Save jl26123/6e1a9afb1bbabd2b065aca466b907608 to your computer and use it in GitHub Desktop.

Select an option

Save jl26123/6e1a9afb1bbabd2b065aca466b907608 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