From 47a657a36c2654855ec9bd770ea52e10341f182d Mon Sep 17 00:00:00 2001 From: Lewis Dale Date: Tue, 26 Sep 2023 15:01:55 +0100 Subject: [PATCH] Rudimentary colour scheme switcher --- .nvmrc | 2 +- src/_includes/base.njk | 64 ++++++++++++++++++++++++++++++++++++++++++ src/css/globals.css | 14 +++++++++ 3 files changed, 79 insertions(+), 1 deletion(-) diff --git a/.nvmrc b/.nvmrc index 2f3b977..6aab9b4 100644 --- a/.nvmrc +++ b/.nvmrc @@ -1 +1 @@ -v18.15.0 \ No newline at end of file +v18.18.0 diff --git a/src/_includes/base.njk b/src/_includes/base.njk index fea4beb..0d79130 100644 --- a/src/_includes/base.njk +++ b/src/_includes/base.njk @@ -34,10 +34,74 @@
  • Links
  • + {{ content | safe }} + + + diff --git a/src/css/globals.css b/src/css/globals.css index a35fee6..6046989 100644 --- a/src/css/globals.css +++ b/src/css/globals.css @@ -14,6 +14,20 @@ } } +body[data-color-scheme="light"] { + --color-secondary: var(--color-neutral-100); + --color-primary: var(--color-neutral-800); + --color-decoration: var(--color-amber-800); + --color-subtle: var(--color-zinc-500); +} + +body[data-color-scheme="dark"] { + --color-primary: var(--color-neutral-200); + --color-secondary: var(--color-neutral-800); + --color-decoration: var(--color-amber-200); + --color-subtle: var(--color-zinc-400); +} + body { background-color: var(--color-secondary); color: var(--color-primary);