From 2b1d197a84624f3906e704713990746b7d6dc451 Mon Sep 17 00:00:00 2001 From: Moshe Vayner Date: Mon, 18 Nov 2024 23:19:54 -0500 Subject: [PATCH] feat(docs): add toggle for light/dark mode support --- mkdocs.yml | 24 ++++++++++++++++++++++-- 1 file changed, 22 insertions(+), 2 deletions(-) diff --git a/mkdocs.yml b/mkdocs.yml index 46eeca8513119..70e7b762be604 100644 --- a/mkdocs.yml +++ b/mkdocs.yml @@ -21,8 +21,28 @@ theme: logo: 'material/cloud-outline' favicon: 'img/logo-notext.svg' palette: - primary: 'teal' - accent: 'green' + # Palette toggle for automatic mode + - media: "(prefers-color-scheme)" + toggle: + icon: material/brightness-auto + name: Switch to light mode + + # Palette toggle for light mode + - media: "(prefers-color-scheme: light)" + scheme: default + primary: 'teal' + accent: 'green' + toggle: + icon: material/brightness-7 + name: Switch to dark mode + + # Palette toggle for dark mode + - media: "(prefers-color-scheme: dark)" + scheme: slate + toggle: + icon: material/brightness-4 + name: Match OS theme (Automatic) + plugins: - search - macros: