From 1074d434d2a186b0c60eb275c034c93e3e874e6f Mon Sep 17 00:00:00 2001 From: Byron Torres Date: Mon, 2 Nov 2020 06:15:58 +0000 Subject: [PATCH] Add dark mode user preference with CSS media query --- main.go | 23 +++++++++++++++++++++++ 1 file changed, 23 insertions(+) diff --git a/main.go b/main.go index c13356d..1950c3c 100644 --- a/main.go +++ b/main.go @@ -286,6 +286,29 @@ dl dt { dl dt:not(:first-child) { margin-top: 0.5rem; } + +@media(prefers-color-scheme:dark) { + html { + background-color: #111; + color: #eee; + } + + blockquote { + background-color: #000; + } + + pre { + background-color: #222; + } + + a { + color: #0087BD; + } + + a:visited { + color: #333399; + } +} ` type GemtextContext struct {