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