From 7a1108058b6c0a0ab634b4c4376cf878376bf124 Mon Sep 17 00:00:00 2001 From: Piotr Gnus Date: Sat, 18 Sep 2021 13:08:29 +0200 Subject: [PATCH] Add dark theme for the documentation (#1230) * 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 --- mkdocs.yml | 12 ++++++++++++ 1 file changed, 12 insertions(+) diff --git a/mkdocs.yml b/mkdocs.yml index 048cf7fe..379f4cbc 100644 --- a/mkdocs.yml +++ b/mkdocs.yml @@ -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