]> gitweb.fluxo.info Git - templates.git/commitdiff
MkDocs: palette toggle for automatic mode
authorSilvio Rhatto <rhatto@riseup.net>
Fri, 2 May 2025 18:20:55 +0000 (15:20 -0300)
committerSilvio Rhatto <rhatto@riseup.net>
Fri, 2 May 2025 18:20:55 +0000 (15:20 -0300)
mkdocs.yml

index 2b74632ec53ed409e911366d51084b006e0a720e..a6c155dbb50ed3cb44ce85c57e60beaf2ad79b03 100644 (file)
@@ -27,8 +27,33 @@ theme:
   collapse_navigation: true
   titles_only        : false
   logo               : https://fluxo.info/images/fluxo.png
+
   palette:
-    primary: blue grey
+    # Palette toggle for automatic mode
+    - media: "(prefers-color-scheme)"
+      #primary: custom
+      primary: blue grey
+      toggle:
+        icon: material/brightness-auto
+        name: Switch to light mode
+
+    # Palette toggle for light mode
+    - media: "(prefers-color-scheme: light)"
+      scheme: default
+      #primary: custom
+      primary: blue grey
+      toggle:
+        icon: material/brightness-7
+        name: Switch to dark mode
+
+    # Palette toggle for dark mode
+    - media: "(prefers-color-scheme: dark)"
+      scheme: slate
+      #primary: custom
+      primary: blue grey
+      toggle:
+        icon: material/brightness-4
+        name: Switch to light mode
 
   # Do not use external fonts
   # Usefult for offline operation