From 629cb24e90cb3ead8424be958f16637002feb59a Mon Sep 17 00:00:00 2001 From: jetstream0 <49297268+jetstream0@users.noreply.github.com> Date: Thu, 31 Aug 2023 08:07:03 +0200 Subject: [PATCH] honour theme preference, add new random --- static/styles/global.css | 23 ++++++++++++++++++++ templates/components/random/email.html | 7 ++++++ templates/components/random/minesweeper.html | 2 +- templates/components/random/rss.html | 2 +- templates/index.html | 1 + 5 files changed, 33 insertions(+), 2 deletions(-) create mode 100644 templates/components/random/email.html diff --git a/static/styles/global.css b/static/styles/global.css index d1b5bea..e35ebc2 100644 --- a/static/styles/global.css +++ b/static/styles/global.css @@ -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; + } +} diff --git a/templates/components/random/email.html b/templates/components/random/email.html new file mode 100644 index 0000000..b6dda64 --- /dev/null +++ b/templates/components/random/email.html @@ -0,0 +1,7 @@ +