Forked from DavidWells/webpack-cssloader-keyframes-example
Created
April 3, 2018 12:55
-
-
Save jl26123/6e1a9afb1bbabd2b065aca466b907608 to your computer and use it in GitHub Desktop.
Example of how to use keyframes in webpack with css-loader + postcss
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| :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