mirror of https://github.com/astral-sh/ruff
[docs] Default to following the system dark/light mode (#7888)
## Summary This fixes the theme toggle so it has the most useful setting on by default: following the system dark/light mode See https://squidfunk.github.io/mkdocs-material/setup/changing-the-colors/#automatic-light-dark-mode ## Test Plan It follows the official docs exactly. If the docs get published for each PR branch, we can also check there if it works as intended. --------- Co-authored-by: konstin <konstin@mailbox.org>
This commit is contained in:
parent
46e45bdf19
commit
d412e8ef74
|
|
@ -14,16 +14,22 @@ theme:
|
||||||
- navigation.top
|
- navigation.top
|
||||||
- content.code.copy
|
- content.code.copy
|
||||||
palette:
|
palette:
|
||||||
|
# Note: Using the system theme works with the insiders version
|
||||||
|
# https://squidfunk.github.io/mkdocs-material/setup/changing-the-colors/#automatic-light-dark-mode
|
||||||
|
- media: "(prefers-color-scheme)"
|
||||||
|
toggle:
|
||||||
|
icon: material/brightness-auto
|
||||||
|
name: Switch to light mode
|
||||||
- media: "(prefers-color-scheme: light)"
|
- media: "(prefers-color-scheme: light)"
|
||||||
scheme: astral-light
|
scheme: astral-light
|
||||||
toggle:
|
toggle:
|
||||||
icon: material/weather-sunny
|
icon: material/brightness-7
|
||||||
name: Switch to dark mode
|
name: Switch to dark mode
|
||||||
- media: "(prefers-color-scheme: dark)"
|
- media: "(prefers-color-scheme: dark)"
|
||||||
scheme: astral-dark
|
scheme: astral-dark
|
||||||
toggle:
|
toggle:
|
||||||
icon: material/weather-night
|
icon: material/brightness-4
|
||||||
name: Switch to light mode
|
name: Switch to system preference
|
||||||
custom_dir: docs/.overrides
|
custom_dir: docs/.overrides
|
||||||
repo_url: https://github.com/astral-sh/ruff
|
repo_url: https://github.com/astral-sh/ruff
|
||||||
repo_name: ruff
|
repo_name: ruff
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue