From 4f1e057079570f8a4d6855e4b4ba32cfda7a18b6 Mon Sep 17 00:00:00 2001 From: wizzdom Date: Fri, 1 Mar 2024 15:33:49 +0000 Subject: [PATCH] add proper dark mode with RB theme --- docs/stylesheets/extra.css | 4 ++++ mkdocs.yml | 25 ++++++++++++++----------- 2 files changed, 18 insertions(+), 11 deletions(-) diff --git a/docs/stylesheets/extra.css b/docs/stylesheets/extra.css index ba65314a..47a055f4 100644 --- a/docs/stylesheets/extra.css +++ b/docs/stylesheets/extra.css @@ -5,3 +5,7 @@ --md-text-font: "Myriad Pro", sans-serif; --md-code-font: "Fira Code", monospace; } + +[data-md-color-scheme="slate"] * { + --md-typeset-a-color: #d62e2e; +} diff --git a/mkdocs.yml b/mkdocs.yml index f4ba3f9f..eef1deee 100644 --- a/mkdocs.yml +++ b/mkdocs.yml @@ -18,21 +18,24 @@ theme: - content.code.copy - content.code.annotate palette: - # Palette toggle for dark mode - - scheme: slate + - media: "(prefers-color-scheme)" toggle: - icon: material/brightness-4 + icon: material/link name: Switch to light mode - primary: custom - accent: custom - - # Palette toggle for light mode - - scheme: default + - media: "(prefers-color-scheme: light)" + scheme: default + primary: indigo + accent: indigo toggle: - icon: material/brightness-7 + icon: material/toggle-switch name: Switch to dark mode - primary: custom - accent: custom + - media: "(prefers-color-scheme: dark)" + scheme: slate + primary: black + accent: red + toggle: + icon: material/toggle-switch-off + name: Switch to system preference plugins: - awesome-pages