From a19887546b4319970607d36e7553fae957837387 Mon Sep 17 00:00:00 2001 From: Carlos Rueda Date: Fri, 14 Oct 2022 03:41:56 -0700 Subject: [PATCH] docs: add dark mode (#1412) --- docs/stylesheets/theme.css | 6 +++++- mkdocs.yml | 13 +++++++++++-- 2 files changed, 16 insertions(+), 3 deletions(-) diff --git a/docs/stylesheets/theme.css b/docs/stylesheets/theme.css index 34f507d..29344ba 100644 --- a/docs/stylesheets/theme.css +++ b/docs/stylesheets/theme.css @@ -6,6 +6,10 @@ --md-accent-fg-color--transparent: #00334310; } +[data-md-color-scheme="slate"] { + --md-typeset-a-color: #7f9ece; +} + .md-header-nav__button.md-logo { padding: 0; } @@ -13,4 +17,4 @@ .md-header-nav__button.md-logo img { width: 1.6rem; height: 1.6rem; -} \ No newline at end of file +} diff --git a/mkdocs.yml b/mkdocs.yml index 57b2f7b..ed4ffd2 100644 --- a/mkdocs.yml +++ b/mkdocs.yml @@ -5,7 +5,16 @@ edit_uri: edit/main/docs/ theme: name: 'material' palette: - scheme: containrrr + - media: "(prefers-color-scheme: light)" + scheme: containrrr + toggle: + icon: material/weather-night + name: Switch to dark mode + - media: "(prefers-color-scheme: dark)" + scheme: slate + toggle: + icon: material/weather-sunny + name: Switch to light mode logo: images/logo-450px.png favicon: images/favicon.ico extra_css: @@ -24,7 +33,7 @@ markdown_extensions: repo: watchtower - pymdownx.saneheaders - pymdownx.tabbed: - alternate_style: true + alternate_style: true nav: - 'Home': 'index.md' - 'Introduction': 'introduction.md'