honour theme preference, add new random
This commit is contained in:
@@ -11,6 +11,7 @@ body {
|
||||
box-sizing: border-box;
|
||||
min-height: 100vh;
|
||||
padding: 35px 10vw;
|
||||
background-color: white;
|
||||
color: #222;
|
||||
}
|
||||
|
||||
@@ -115,3 +116,25 @@ label[for="dark-mode"]:hover {
|
||||
color: white;
|
||||
content: "☀️";
|
||||
}
|
||||
|
||||
@media (prefers-color-scheme: dark) {
|
||||
#dark-mode + label[for="dark-mode"]::after {
|
||||
color: white;
|
||||
content: "☀";
|
||||
}
|
||||
|
||||
#dark-mode:checked + label[for="dark-mode"]::after {
|
||||
color: black;
|
||||
content: "🌙";
|
||||
}
|
||||
|
||||
#main {
|
||||
background-color: #222;
|
||||
color: white;
|
||||
}
|
||||
|
||||
#dark-mode:checked ~ #main {
|
||||
background-color: white;
|
||||
color: #222;
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user