Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Separate out "dark settings" and "light settings", for themes that automatically switch between dark/light settings based on OS #27

Open
ELLIOTTCABLE opened this issue Sep 30, 2021 · 0 comments

Comments

@ELLIOTTCABLE
Copy link

The built-in "System theme" FireFox theme ('Follow the system theme …'), along with a few others (such as Firefox Alpenglow include a dark_theme manifest-entry; which is then used whenever the operating-system is set to "dark mode":

Screen Shot 2021-09-30 at 1 47 37 PM

Unfortunately, since TST-Colored-Tabs only supports one set of colour settings, you're pretty much guaranteed for those settings to look terrible on whichever background they're not catering to:

Screen Shot 2021-09-30 at 1 48 17 PM

There's not currently an API to explicitly determine whether the theme is "dark" mode or "light" mode; but you can use browser.theme.getCurrent() to extract the current settings, and add a listener to browser.theme.onUpdated to be notified whenever the system-theme changes; there's a good example of this in the firefox-audio-compressor addon:

https://github.com/vatara/firefox-audio-compressor/blob/91312ccd46eaf588295316b83301b6f280a41f12/src/background.js#L36-L64

Further reading: https://bugzilla.mozilla.org/show_bug.cgi?id=1542044

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant