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 <marcelotryle@gmail.com>
This commit is contained in:
Piotr Gnus 2021-09-18 13:08:29 +02:00 committed by GitHub
parent 48dea4ddf1
commit 7a1108058b
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
1 changed files with 12 additions and 0 deletions

View 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