]> git.ipfire.org Git - thirdparty/starlette.git/commitdiff
Add dark theme for the documentation (#1230)
authorPiotr Gnus <gbdlin@users.noreply.github.com>
Sat, 18 Sep 2021 11:08:29 +0000 (13:08 +0200)
committerGitHub <noreply@github.com>
Sat, 18 Sep 2021 11:08:29 +0000 (13:08 +0200)
* mkdocs: expanded theme configuration to add alternative dark theme.
  The default theme will be determined by the users system theme by the
  `prefers-color-scheme` media query.

Co-authored-by: Marcelo Trylesinski <marcelotryle@gmail.com>
mkdocs.yml

index 048cf7fe0364c0c118a2672b0a8ed2fb8432a475..379f4cbc54bbd57926713bcc95addaf56dc5ecb5 100644 (file)
@@ -5,6 +5,18 @@ site_url: https://www.starlette.io
 theme:
   name: 'material'
   custom_dir: docs/overrides
+  palette:
+    - scheme: 'default'
+      media: '(prefers-color-scheme: light)'
+      toggle:
+        icon: 'material/lightbulb'
+        name: "Switch to dark mode"
+    - scheme: 'slate'
+      media: '(prefers-color-scheme: dark)'
+      primary: 'blue'
+      toggle:
+        icon: 'material/lightbulb-outline'
+        name: 'Switch to light mode'
 
 repo_name: encode/starlette
 repo_url: https://github.com/encode/starlette