42 lines
601 B
SCSS
42 lines
601 B
SCSS
|
.darkmode {
|
||
|
float: right;
|
||
|
padding: 1rem;
|
||
|
min-width: 30px;
|
||
|
position: relative;
|
||
|
|
||
|
& > .toggle {
|
||
|
display: none;
|
||
|
box-sizing: border-box;
|
||
|
}
|
||
|
|
||
|
& svg {
|
||
|
cursor: pointer;
|
||
|
opacity: 0;
|
||
|
position: absolute;
|
||
|
width: 20px;
|
||
|
height: 20px;
|
||
|
top: calc(50% - 10px);
|
||
|
margin: 0 7px;
|
||
|
fill: var(--darkgray);
|
||
|
transition: opacity 0.1s ease;
|
||
|
}
|
||
|
}
|
||
|
|
||
|
:root[saved-theme="dark"] .toggle ~ label {
|
||
|
& > #dayIcon {
|
||
|
opacity: 0;
|
||
|
}
|
||
|
& > #nightIcon {
|
||
|
opacity: 1;
|
||
|
}
|
||
|
}
|
||
|
|
||
|
:root .toggle ~ label {
|
||
|
& > #dayIcon {
|
||
|
opacity: 1;
|
||
|
}
|
||
|
& > #nightIcon {
|
||
|
opacity: 0;
|
||
|
}
|
||
|
}
|