From 7e38d7f84463342dd428e7400777fdc675a8fbce Mon Sep 17 00:00:00 2001 From: stuebinm Date: Thu, 8 Apr 2021 16:01:26 +0200 Subject: site: add a rudimentary dark mode This is a very simple, very high-contrast dark mode (for now). However, not all default ui elements seem to respect it by default — i.e. textareas stay entirely white by default and require additional theming. I'm not sure if this is my system stlye or firefox interfering, but for now I've added custom css rules which at least make text areas black. Buttons and checkboxes are still white, however. --- site/style.css | 26 ++++++++++++++++++++++++++ todo.org | 3 +-- 2 files changed, 27 insertions(+), 2 deletions(-) diff --git a/site/style.css b/site/style.css index b8be0dd..08f22a6 100644 --- a/site/style.css +++ b/site/style.css @@ -30,3 +30,29 @@ textarea { resize: vertical; min-height: 2em; } + + +@media screen and (prefers-color-scheme: dark) { + + html { + background-color: black; + color: white; + } + + body { + background-color: black; + box-shadow: none; + border: 2px solid white; + border-radius: 1em; + } + + .error { + color: red; + } + + textarea { + color: white; + background-color: black; + } + +} diff --git a/todo.org b/todo.org index b5f0d88..3ea98c0 100644 --- a/todo.org +++ b/todo.org @@ -17,9 +17,8 @@ * TODO List of public surveys * IDEA CLI tool for age batch decryption & conversion to .csv - * TODO UI ** IDEA Surveys with multiple pages Seems unclear how to do this in a way that also works with screen readers etc. -** TODO Automatic Dark mode ** TODO Support for multiple languages (defined via config.dhall) +** DONE Automatic Dark mode -- cgit v1.2.3