Skip to content

Instantly share code, notes, and snippets.

@hakimel
Last active May 30, 2020 13:45
Show Gist options
  • Save hakimel/683c07361b459d217279de6f94d32686 to your computer and use it in GitHub Desktop.
Save hakimel/683c07361b459d217279de6f94d32686 to your computer and use it in GitHub Desktop.
@keyframes dark-mode-icon-in {
0% { transform: rotate(90deg); }
100% { transform: rotate(0deg); }
}
@keyframes dark-mode-icon-out {
0% { transform: rotate(0deg); }
100% { transform: rotate(-90deg); }
}
.icon-sun,
.icon-moon {
transform-origin: 50% 200%;
transition: opacity 0.4s ease;
animation-fill-mode: forwards;
}
.icon-sun {
animation: dark-mode-icon-in 0.4s ease;
}
.icon-moon {
color: yellow;
opacity: 0;
animation: dark-mode-icon-out 0.4s ease;
}
[data-speaker-theme="dark"] .icon-sun {
opacity: 0;
animation: dark-mode-icon-out 0.4s ease;
}
[data-speaker-theme="dark"] .icon-moon {
opacity: 1;
animation: dark-mode-icon-in 0.4s ease;
}
@SMontiel
Copy link

Thanks!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment