Skip to content

Instantly share code, notes, and snippets.

@lonekorean
Created March 3, 2018 20:20
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save lonekorean/7b9974c99db1fcb80b40f06588f83e0e to your computer and use it in GitHub Desktop.
Save lonekorean/7b9974c99db1fcb80b40f06588f83e0e to your computer and use it in GitHub Desktop.
CSS to animate polka dot fade
.polka-dot {
--dot-spacing: 20px;
--dot-fade-offset: 0%;
--dot-color: #fc466b;
background: paint(polka-dot-fade);
/* other styles as needed... */
}
.polka-dot:hover, .polka-dot:focus {
animation: pulse 2s ease-out 6 alternate;
/* other styles as needed... */
}
@keyframes pulse {
from {
--dot-fade-offset: 0%;
--dot-color: #fc466b;
}
to {
--dot-fade-offset: 100%;
--dot-color: #3f5efb;
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment