From 9045afcc60f96f1d64fc9fd9491a75d8a065dcfe Mon Sep 17 00:00:00 2001 From: Meysam Azad Date: Sat, 23 Mar 2024 16:55:08 +0700 Subject: [PATCH 1/3] docs: add dark-mode capability --- mkdocs.yml | 16 +++++++++++++++- 1 file changed, 15 insertions(+), 1 deletion(-) diff --git a/mkdocs.yml b/mkdocs.yml index edcc56a549..754cd55517 100644 --- a/mkdocs.yml +++ b/mkdocs.yml @@ -21,7 +21,21 @@ theme: - navigation.top - navigation.expand palette: - primary: custom + - media: (prefers-color-scheme) + primary: custom + toggle: + icon: material/brightness-auto + name: Switch to light mode + - media: "(prefers-color-scheme: light)" + scheme: default + toggle: + icon: material/brightness-7 + name: Switch to dark mode + - media: "(prefers-color-scheme: dark)" + scheme: slate + toggle: + icon: material/brightness-4 + name: Switch to system preference custom_dir: site-src/overrides edit_uri: edit/main/site-src/ plugins: From f733288388316c5242865368a1a1d78ac8658ead Mon Sep 17 00:00:00 2001 From: Meysam Azad Date: Tue, 9 Apr 2024 10:34:28 +0700 Subject: [PATCH 2/3] chore: pick light mode as the defualt --- mkdocs.yml | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/mkdocs.yml b/mkdocs.yml index 754cd55517..306915adaa 100644 --- a/mkdocs.yml +++ b/mkdocs.yml @@ -21,16 +21,16 @@ theme: - navigation.top - navigation.expand palette: - - media: (prefers-color-scheme) - primary: custom - toggle: - icon: material/brightness-auto - name: Switch to light mode - media: "(prefers-color-scheme: light)" scheme: default toggle: icon: material/brightness-7 name: Switch to dark mode + - media: (prefers-color-scheme) + primary: custom + toggle: + icon: material/brightness-auto + name: Switch to light mode - media: "(prefers-color-scheme: dark)" scheme: slate toggle: From 8bfa4d52a5b8055aa7637ecce3698310aaabd2c8 Mon Sep 17 00:00:00 2001 From: Meysam Azad Date: Sat, 20 Apr 2024 11:08:49 +0700 Subject: [PATCH 3/3] fix: set the custom primary color for the default light mode --- mkdocs.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/mkdocs.yml b/mkdocs.yml index bac6019c87..98d4639b71 100644 --- a/mkdocs.yml +++ b/mkdocs.yml @@ -23,11 +23,11 @@ theme: palette: - media: "(prefers-color-scheme: light)" scheme: default + primary: custom toggle: icon: material/brightness-7 name: Switch to dark mode - media: (prefers-color-scheme) - primary: custom toggle: icon: material/brightness-auto name: Switch to light mode