From d10bf6a003354447ac596304db895402c421c0e9 Mon Sep 17 00:00:00 2001 From: Kamal Nayan Date: Sun, 20 Jun 2021 19:35:19 +0200 Subject: [PATCH] Add basic dark mode --- tufte.css | 15 +++++++++++++++ 1 file changed, 15 insertions(+) diff --git a/tufte.css b/tufte.css index 976bbd9..4c8fd63 100644 --- a/tufte.css +++ b/tufte.css @@ -56,6 +56,14 @@ body { counter-reset: sidenote-counter; } +/* Adds dark mode */ +@media (prefers-color-scheme: dark) { + body { + background-color: #151515; + color: #ddd; + } +} + h1 { font-weight: 400; margin-top: 4rem; @@ -248,6 +256,13 @@ a:link, .tufte-underline, .hover-tufte-underline:hover { } } +/* Adds dark mode */ +@media (prefers-color-scheme: dark) { + a:link, .tufte-underline, .hover-tufte-underline:hover { + text-shadow: 0.03em 0 #151515, -0.03em 0 #151515, 0 0.03em #151515, 0 -0.03em #151515, 0.06em 0 #151515, -0.06em 0 #151515, 0.09em 0 #151515, -0.09em 0 #151515, 0.12em 0 #151515, -0.12em 0 #151515, 0.15em 0 #151515, -0.15em 0 #151515; + } +} + a:link::selection, a:link::-moz-selection { text-shadow: 0.03em 0 #b4d5fe, -0.03em 0 #b4d5fe, 0 0.03em #b4d5fe, 0 -0.03em #b4d5fe, 0.06em 0 #b4d5fe, -0.06em 0 #b4d5fe, 0.09em 0 #b4d5fe, -0.09em 0 #b4d5fe, 0.12em 0 #b4d5fe, -0.12em 0 #b4d5fe, 0.15em 0 #b4d5fe, -0.15em 0 #b4d5fe;