Beautiful theme switch

This commit is contained in:
2022-10-16 15:59:08 +02:00
parent 2b3c4e2482
commit 068a3f8f1e
8 changed files with 122 additions and 37 deletions

View File

@ -54,13 +54,4 @@
.spacer {
flex-grow: 2;
}
.themeSwitch {
.lightTheme {
display: var(--blog_dark-el-display)
}
.darkTheme {
display: var(--blog_light-el-display)
}
}
}

View File

@ -0,0 +1,41 @@
.switch {
position: relative;
width: 1.5em;
height: 1.5em;
& > * {
position: absolute;
}
.fadeOut {
animation: fadeOut 0.2s ease-in-out;
animation-fill-mode: forwards;
}
.fadeIn {
animation: fadeIn 0.2s ease-in-out;
animation-fill-mode: forwards;
}
}
@keyframes fadeOut {
from {
opacity: 1;
transform: translate(0, 0);
}
to {
opacity: 0;
transform: translate(0, -100%);
}
}
@keyframes fadeIn {
from {
opacity: 0;
transform: translate(0, 100%);
}
to {
opacity: 1;
transform: translate(0, 0);
}
}