Last active
August 13, 2020 17:21
-
-
Save znck/a4859d40e7d57defe967f0f5ccf55593 to your computer and use it in GitHub Desktop.
CSS only shimmer
This file contains 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
@keyframes placeHolderShimmer { | |
0% { | |
background-position: -80px 0; | |
} | |
100% { | |
background-position: 640px 0; | |
} | |
} | |
.u-placeholder-shimmer { | |
pointer-events: none; | |
color: transparent; | |
animation-duration: 1.25s; | |
animation-fill-mode: forwards; | |
animation-iteration-count: infinite; | |
animation-name: placeHolderShimmer; | |
animation-timing-function: linear; | |
background-color: #f6f6f6; | |
background-image: linear-gradient(to right, #f6f6f6 0%, #eeeeee 50%, #f6f6f6 100%); | |
background-size: 80px 100%; | |
background-repeat: no-repeat; | |
background-position: 0 0; | |
border-radius: 0.25em; | |
} | |
.u-placeholder-shimmer * { | |
color: transparent !important; | |
border-color: transparent !important; | |
background: transparent !important; | |
box-shadow: none !important; | |
text-shadow: none !important; | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment