skhzhang / time-based-themes

Automatically change Firefox's theme based on the time
MIT License
121 stars 13 forks source link

Feature Request: Override Webpage Colorscheme #30

Open MintMain21 opened 2 years ago

MintMain21 commented 2 years ago

Is your feature request related to a problem? Please describe. Before Firefox 100, the browser would automatically paint websites (including settings) in a light or dark theme based on the color of the address bar (white background/black text vs back background/white text). With Firefox 100 however, themes must now be labeled as light or dark in their code, which means even if the browser is set to recognize light/dark mode based on the theme instead of the OS, it will ignore the theme and default to OS if the new label isn't in the code. This means that most themes must be updated with the labels, and themes that are unmaintained will not get the necessary update. Not to mention, most users probably built their themes out of the unmaintained Firefox Color extension, which effectively makes them unmaintained unless the users learned proper coding at a later date.

Describe the solution you'd like Seeing as this extension is the best alternative to default theming options, I think it would be nice if this extension offered the option to override a theme's labels (or lack there-of) with Light/Dark depending on what time of day they are set for. So, for example, I could set the same theme for both day and night, but if I set "Override Webpage Colorsheme" on both Day and Night, then the extension will enforce Light Webpage Themes by day, Dark Webpage Themes by night, so long as in the browser settings I have Website Appearance set to "browser theme" instead of "System Theme", "Light", or "Dark". This would allow me, and plenty of other users, the freedom to mix and match whatever themes we like without any concern for if they'll be interpreted as light or dark, since the extension will do the interpreting.

Additional context Thanks again for developing this great extension.

haoadoreorange commented 2 years ago

@skhzhang I second this, while I understand this change from Firefox, it will leave a lot of great legacy themes unsuable as thoses will never be updated.

@MintMain21 Do you know if it's possible to overwrite a theme's label at all ?

Otherwise there is another workaround here, that is to ovewrite layout.css.prefers-color-scheme.content-override to 0 or 1 when changing theme to force content color scheme, I tested it and it works, look at this thread https://support.mozilla.org/bm/questions/1365222.

dnut commented 2 years ago

The way this should work is by changing the actual Website Appearance selection directly. I don't think it makes sense to try messing with the data internal to a theme. If this change is implemented, I would expect to have two new dropdowns in the addon settings page (analogous to the existing dropdowns) that would have each of these four options from the image below. Then I would expect the selected option in the firefox settings to change automatically according to the time of day. So for example, light could be selected during the day here, and dark during the night: Screenshot from 2022-08-03 08-57-54

This is actually what I was looking for when I installed this addon. I tried setting this config to "firefox theme" and using this addon to switch between light and dark firefox themes--only because I wanted to change the webpage appearance. But frankly the light firefox theme looks ridiculous and I can't tolerate it even during full sunshine. So I just flip this switch manually twice a day instead of using the addon. Don't get me started on Dark Reader, its scope is limited. It cannot do the same thing as this firefox setting.

themes must now be labeled as light or dark in their code

If this is how firefox decides the webpage appearance from firefox theme, another way to accomplish what you're looking for would be to simply duplicate the theme you like, having one that announces itself as dark and one that announces itself as light. Then you could use the existing addon to toggle between them, with webpage appearance configured to "firefox theme."