Skip to content

Commit

Permalink
[docs] Default to following the system dark/light mode (#7888)
Browse files Browse the repository at this point in the history
## 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>
  • Loading branch information
flying-sheep and konstin committed Oct 11, 2023
1 parent 6a199fd commit e22937e
Showing 1 changed file with 9 additions and 3 deletions.
12 changes: 9 additions & 3 deletions mkdocs.template.yml
Original file line number Diff line number Diff line change
Expand Up @@ -14,16 +14,22 @@ theme:
- navigation.top
- content.code.copy
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)"
scheme: astral-light
toggle:
icon: material/weather-sunny
icon: material/brightness-7
name: Switch to dark mode
- media: "(prefers-color-scheme: dark)"
scheme: astral-dark
toggle:
icon: material/weather-night
name: Switch to light mode
icon: material/brightness-4
name: Switch to system preference
custom_dir: docs/.overrides
repo_url: https://github.com/astral-sh/ruff
repo_name: ruff
Expand Down

0 comments on commit e22937e

Please sign in to comment.