Skip to content

Commit

Permalink
πŸ’„ Add automatic light/dark theme toggle
Browse files Browse the repository at this point in the history
Replace light and dark toggle icons resp. with sun and moon+stars.

Use system preferences.
See: https://squidfunk.github.io/mkdocs-material/setup/changing-the-colors/#automatic-light-dark-mode
  • Loading branch information
ebouchut committed Jan 28, 2024
1 parent b5ced55 commit 78a359f
Showing 1 changed file with 10 additions and 3 deletions.
13 changes: 10 additions & 3 deletions mkdocs.yml
Original file line number Diff line number Diff line change
Expand Up @@ -17,21 +17,28 @@ theme:
logo: loop-logo.png
favicon: loop-logo.png
palette:

# Palette toggle for automatic mode
- media: "(prefers-color-scheme)"
toggle:
icon: material/brightness-auto
name: Switch to light mode

# Palette toggle for light mode
- media: "(prefers-color-scheme: light)"
scheme: default
primary: custom
toggle:
icon: material/brightness-7
icon: material/weather-sunny
name: Switch to dark mode

# Palette toggle for dark mode
- media: "(prefers-color-scheme: dark)"
scheme: slate
primary: custom
toggle:
icon: material/brightness-4
name: Switch to light mode
icon: material/weather-night
name: Switch to auto (use System Preferences)

# repo_url: https://github.com/LoopKit/Loop

Expand Down

0 comments on commit 78a359f

Please sign in to comment.