ar.falsy.cat/assets/styles/darkmode.scss

44 lines
625 B
SCSS
Raw Normal View History

2021-07-18 13:35:42 +00:00
.darkmode {
2021-08-27 18:08:11 +00:00
float: right;
padding: 1em;
min-width: 30px;
position: relative;
@media all and (max-width: 450px) {
padding: 1em;
}
2021-07-18 13:35:42 +00:00
& > .toggle {
display: none;
box-sizing: border-box;
}
2021-08-27 18:08:11 +00:00
& svg {
opacity: 0;
position: absolute;
2021-07-18 13:35:42 +00:00
width: 20px;
height: 20px;
2021-08-27 18:08:11 +00:00
top: calc(50% - 10px);
2021-07-18 13:35:42 +00:00
margin: 0 7px;
fill: var(--gray);
2021-08-27 18:08:11 +00:00
transition: opacity 0.1s ease;
2021-07-18 13:35:42 +00:00
}
2021-08-27 18:08:11 +00:00
}
2021-07-18 13:35:42 +00:00
2021-08-27 18:08:11 +00:00
.toggle:checked ~ label {
& > #dayIcon {
opacity: 0;
}
& > #nightIcon {
opacity: 1;
}
}
.toggle:not(:checked) ~ label {
& > #dayIcon {
opacity: 1;
}
& > #nightIcon {
opacity: 0;
2021-07-18 13:35:42 +00:00
}
}