Skip to content

Instantly share code, notes, and snippets.

@znck
Last active August 13, 2020 17:21
Show Gist options
  • Save znck/a4859d40e7d57defe967f0f5ccf55593 to your computer and use it in GitHub Desktop.
Save znck/a4859d40e7d57defe967f0f5ccf55593 to your computer and use it in GitHub Desktop.
CSS only shimmer
@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