mirror of
https://github.com/squidfunk/mkdocs-material.git
synced 2024-06-14 11:52:32 +03:00
Documentation
This commit is contained in:
parent
5184ed9a4b
commit
c0c3a8fbf5
@ -195,7 +195,8 @@ theme:
|
|||||||
palette:
|
palette:
|
||||||
|
|
||||||
# Light mode
|
# Light mode
|
||||||
- scheme: default
|
- media: "(prefers-color-scheme: light)"
|
||||||
|
scheme: default
|
||||||
primary: indigo
|
primary: indigo
|
||||||
accent: indigo
|
accent: indigo
|
||||||
toggle:
|
toggle:
|
||||||
@ -203,7 +204,8 @@ theme:
|
|||||||
name: Switch to dark mode
|
name: Switch to dark mode
|
||||||
|
|
||||||
# Dark mode
|
# Dark mode
|
||||||
- scheme: slate
|
- media: "(prefers-color-scheme: dark)"
|
||||||
|
scheme: slate
|
||||||
primary: blue
|
primary: blue
|
||||||
accent: blue
|
accent: blue
|
||||||
toggle:
|
toggle:
|
||||||
@ -211,7 +213,9 @@ theme:
|
|||||||
name: Switch to light mode
|
name: Switch to light mode
|
||||||
```
|
```
|
||||||
|
|
||||||
This will render a color palette toggle in the header next to the search bar:
|
In order to set a default theme based on user preference, add a valid media
|
||||||
|
query to the `media` attribute. This will render a color palette toggle in the
|
||||||
|
header next to the search bar:
|
||||||
|
|
||||||
<figure markdown="1">
|
<figure markdown="1">
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user