Skip to content

Instantly share code, notes, and snippets.

@gko
Last active June 27, 2023 00:24
Show Gist options
  • Star 1 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save gko/c16ad2e0ac67c0d8d29067a1565c8c38 to your computer and use it in GitHub Desktop.
Save gko/c16ad2e0ac67c0d8d29067a1565c8c38 to your computer and use it in GitHub Desktop.
setTimeout mixin
/**
* @include setTimeout(timeout) {
* properties to change to
* }
*/
@use "sass:string";
@mixin setTimeout($timeout) {
$animation-name: animation-#{string.unique_id()};
animation-name: $animation-name;
animation-duration: 0s;
animation-delay: $timeout;
animation-iteration-count: 1;
animation-fill-mode: forwards;
@keyframes #{$animation-name} {
100% {
@content;
}
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment