-
Notifications
You must be signed in to change notification settings - Fork 0
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
Obey theme switch in Gnome #8
Comments
Thanks for reporting. In Firefox for some of my addons I'm using CSS feature I will investigate or try to look for a better solution. |
So I've been looking into this and I found an issue in Thunderbird - the theme change that originates in operating system is not reported to the extension code. Let's see what they say about it. |
@fastaddons Thanks for explaining this issue and reporting it to bugzilla!
@media (prefers-color-scheme: light) {
body {
color: black; background-color: white
}
}
@media (prefers-color-scheme: dark) {
body {
color: white; background-color: #1C1B22
}
:link {color: #8C8CFF}
:visited {color: #FFADFF}
}
Edit: @media (prefers-color-scheme: light) {
#messagepane {
color: black; background-color: white
}
}
@media (prefers-color-scheme: dark) {
#messagepane {
filter: invert(100%) hue-rotate(180deg);
}
} To revert the filter for images, we have to apply it again, but using the @media (prefers-color-scheme: dark) {
/* Undo inversion for images (to make them appear normal again) */
.moz-text-html img {
filter: invert(100%) hue-rotate(180deg) !important;
}
} which, for now, fully replaces Darko for me 😨
Also cool: this solution does not have the white flashes described in #18, which is a remaining issue of Darko. The message panel (including the header) may still be white-ish ( Since #viewsource {
background-color: #1C1B22 !important;
} Edit 2: /* Also undo inversion for background images */
[style*="background-image:"], [background*="."] {
filter: invert(100%) hue-rotate(180deg) !important;
}
/* If an email supports dark and light themes (like from Pocket), enforce light theme (which will be inverted) */
html[style*="color-scheme"] {
color-scheme: light !important;
} The first addition should address #9 (undoing the inversion for background images). PS: I wonder how to detect and deal with emails that already have some dark appearance. I guess this calls for more JS logic. |
I can't believe it's been 2 years! I feel like I've build this addon just months ago :). I've been very busy with my other addons so my Darko wasn't getting a lot of attention. Also, since "Dark Reader" is now compatible with Thunderbird, I've lost a lot of motivation working it :(. |
Great, Juraj! I'm happy that you'll welcome those investigations. The only reason I spent time on this is because Dark Reader doesn't work in my Thunderbird, see related open issues. In my case (Thunderbird v102), the popup simply says "Loading, please wait". While I appreciate Dark Reader in Firefox, I like the simple CSS customization that you took with Darko or that I took with |
This is some good findings, @mherrmann3, thanks for the research! I'm especially interested in trying to find a way to consistently use the same "dark" color in my Donker extension as what Thunderbird would normally use for its dark background. The tricky part about figuring out if a mail is already being sent in dark mode, is that they can basically set the color anywhere. For example, Steam sends dark mode emails by default, but annoyingly the For me, Steam is one of the very few senders that gives me dark mode email, so it's not a big deal for me to just click the toolbar button to de-invert it for just that email. This is perhaps the benefit of using an extension over just a stylesheet mod - it's easy to either click the button (like Donker) or add the sender to a "darklist" (like Darko). |
Is your feature request related to a problem? Please describe.
In general, a dark mode function does not depend on the time but on the sunset in the current region. Hence, the automatic switch by time is not useful.
Describe the solution you'd like
Gnome supports changing the theme depending on the sunset in the current region. Dark should do the same. Windows does support a night light as well. Not sure how macOS handles this.
The text was updated successfully, but these errors were encountered: