Skip to content

Instantly share code, notes, and snippets.

@SMontiel
Forked from hakimel/sunandmoon.scss
Created May 30, 2020 13:44
Show Gist options
  • Save SMontiel/16b8c0f48746ad4180bbb815cf6431f0 to your computer and use it in GitHub Desktop.
Save SMontiel/16b8c0f48746ad4180bbb815cf6431f0 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;
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment