Added dark mode for the site

Posted
Categories
note
Tags
sitecss

Got tired of blowing my eyeballs out during evening work.

How? I used prefers-color-scheme. It tries to respect existing light/dark mode settings. Here’s the stylesheet short version.

:root {
--text-color: hsl(0, 0%, 0%);
--content-background-color: hsla(0, 0%, 100%, 0.8);
}
@media (prefers-color-scheme: dark) {
:root {
--text-color: hsl(0, 0%, 100%);
--content-background-color: hsla(0, 0%, 0%, 0.8);
}
}
#page-content {
background-color: var(--content-background-color)
color: var(--text-color);
}
Got a comment? A question? More of a comment than a question?
Talk to me about this page on: Hacker's Town