feat: add auto dark/light theme support to starter config via prefers-color-scheme
#213
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
✨ Add automatic dark/light theme support via
prefers-color-scheme
This update adds system theme synchronization to zebar using the CSS media query prefers-color-scheme.
Now, zebar will automatically adapt to your operating system's light or dark mode — no manual toggling required.
🎨 What changed
prefers-color-scheme: light
andprefers-color-scheme: dark
.--text-size
--icon-size
🧠 Motivation
As a Windows 11 user with auto dark mode based on sunset/sunrise, I’ve always found it frustrating that the default zebar preset didn’t follow the system theme.
This small but meaningful tweak makes zebar feel more native, more modern, and better integrated into the daily workflow.
Also, there was previously no convenient way to customize font or icons size. With the new variables, it's now a little bit easier to adjust the UI to our preferences.
✅ Compatibility
🔄 Related
This might be an alternative way to partly resolve #203.
📸 Demo
Before (always dark mode)
before.mp4
After (auto light/dark)
after.mp4
Thanks for creating and maintaining glazewm & zebar 🙌