From 80d6cae3e868172b2e4a809305f8b51675d68199 Mon Sep 17 00:00:00 2001 From: Runxi Yu Date: Tue, 11 Feb 2025 10:47:23 +0800 Subject: [PATCH] style.css: Add dark theme --- static/style.css | 17 +++++++++++++++++ diff --git a/static/style.css b/static/style.css index 46558f60b70f801964b570fe1435f0ffb7f06d94..04b26122a5216410c27eb09d8fa4109f68989931 100644 --- a/static/style.css +++ b/static/style.css @@ -1,5 +1,9 @@ html { font-family: sans-serif; + background-color: var(--background-color); + color: var(--text-color); + --background-color: hsl(0, 0%, 100%); + --text-color: hsl(0, 0%, 0%); --link-color: hsl(320, 50%, 36%); --light-text-color: hsl(0, 0%, 45%); --darker-border-color: hsl(0, 0%, 72%); @@ -7,6 +11,19 @@ --lighter-border-color: hsl(0, 0%, 85%); --text-decoration-color: hsl(0, 0%, 72%); --darker-box-background-color: hsl(0, 0%, 92%); --lighter-box-background-color: hsl(0, 0%, 95%); +} +@media (prefers-color-scheme: dark) { + html { + --background-color: hsl(0, 0%, 0%); + --text-color: hsl(0, 0%, 100%); + --link-color: hsl(320, 50%, 64%); + --light-text-color: hsl(0, 0%, 78%); + --darker-border-color: hsl(0, 0%, 35%); + --lighter-border-color: hsl(0, 0%, 25%); + --text-decoration-color: hsl(0, 0%, 30%); + --darker-box-background-color: hsl(0, 0%, 20%); + --lighter-box-background-color: hsl(0, 0%, 15%); + } } html, code, pre { font-size: 1rem; /* TODO: Not always correct */ -- 2.48.1