From f213a499e2fb90bf5775fe9180f2a843fe638535 Mon Sep 17 00:00:00 2001 From: Lewis Dale Date: Tue, 26 Sep 2023 17:06:52 +0100 Subject: [PATCH] Style the colour picker --- src/_includes/base.njk | 83 +++++++++------------- src/css/exceptions/color-scheme-picker.css | 42 +++++++++++ 2 files changed, 77 insertions(+), 48 deletions(-) create mode 100644 src/css/exceptions/color-scheme-picker.css diff --git a/src/_includes/base.njk b/src/_includes/base.njk index 0d79130..8db9eb0 100644 --- a/src/_includes/base.njk +++ b/src/_includes/base.njk @@ -34,15 +34,7 @@
  • Links
  • - - - {{ content | safe }} - - - + + {{ content | safe }} + + + diff --git a/src/css/exceptions/color-scheme-picker.css b/src/css/exceptions/color-scheme-picker.css new file mode 100644 index 0000000..37e06ed --- /dev/null +++ b/src/css/exceptions/color-scheme-picker.css @@ -0,0 +1,42 @@ +.color-scheme { + border: 0; + display: flex; + gap: var(--space-size-xs); + + legend { + position:absolute; + clip:rect(0 0 0 0); + } + + input[name="color-scheme"] { + position:absolute; + clip:rect(0 0 0 0); + } + + label:has(:not(:checked)) { + color: var(--color-subtle); + } + + label:has(:focus-visible) { + outline: 1px solid var(--color-primary); + outline-offset: 2px; + } + + label:has([name="color-scheme"])::before { + font-family: "font awesome 6 free"; + font-style: normal; + font-variant: normal; + text-rendering: auto; + font-weight: 900; + -webkit-font-smoothing: antialiased; + font-size: var(--text-size-s); + } + + label:has([name="color-scheme"][value="dark"])::before { + content: "\f186"; + } + + label:has([name="color-scheme"][value="light"])::before { + content: "\f185"; + } +} \ No newline at end of file