From 78b0228f4969f2f54a431ad460453bacdc9243a9 Mon Sep 17 00:00:00 2001 From: Paper Date: Wed, 25 Nov 2020 11:20:36 +0100 Subject: [PATCH] Support dark theme using prefers-color-scheme --- pkg/gmitohtml/assets.go | 24 ++++++++++++++++++++++++ 1 file changed, 24 insertions(+) diff --git a/pkg/gmitohtml/assets.go b/pkg/gmitohtml/assets.go index 0f41016..80371c3 100644 --- a/pkg/gmitohtml/assets.go +++ b/pkg/gmitohtml/assets.go @@ -393,5 +393,29 @@ template { [hidden] { display: none; } + +@media (prefers-color-scheme: dark) { + body { + color: white; + background-color: black; + } + h1, h2, h3, h4, h5, h6 { + color: white; + } + a { + color: #8d94ff; + } + a:hover { + color: white; + } + input { + background-color: black; + color: white; + border-color: gray; + border-width: 0.3em; + border-style: solid; + padding: 0.5em; + } +} `, fs) }