From e41ccd0181757f64258e9cad93ade228687cb614 Mon Sep 17 00:00:00 2001 From: Theodore Keloglou Date: Tue, 22 Jun 2021 23:02:20 +0100 Subject: [PATCH] add dark mode --- main/static/style.css | 21 +++++++++++++++++++++ 1 file changed, 21 insertions(+) diff --git a/main/static/style.css b/main/static/style.css index f86ada8..2cc000a 100644 --- a/main/static/style.css +++ b/main/static/style.css @@ -191,12 +191,28 @@ template { --purple-color: #cd1ecd; } +/* dark mode + * create a new color (dark-mode-color) + * override an existing color (dark-grey-color) */ +@media (prefers-color-scheme: dark) { + :root { + --dark-mode-color: #1c1b22; + --dark-grey-color: #78828a; + } +} + html, body { font-family: sans-serif; font-size: 14px; line-height: 1.5; } +@media (prefers-color-scheme: dark) { + body { + color: #fff; + background: var(--dark-mode-color); + } +} a { text-decoration: none; @@ -619,6 +635,11 @@ form .helptext { .webring-name { color: #000; } +@media (prefers-color-scheme: dark) { + .webring-name { + color: #fff; + } +} /* post detail */ .posts-item-title { -- 2.34.5