Closed Madis0 closed 6 years ago
reStyle can theme itself. All the colors in the main UI are specified in this file.
If you create a copy of that as a user style, wrap it in a @document
block and replace all the color, you should be able to build a light theme rather quickly.
@-moz-document
regexp("moz-extension://[\w-]+/reStyle(?!#panel).*")
{
/* modified theme */
}
If the result looks decent I am happy to include it in the extension itself (and would then also change the panel and a bit of other stuff accordingly).
Dammit. I just realized this this won't work. the "tabs" in the main UI are about:blank
frames, so the above won't apply.
I've been meaning to change that, but for now the only way to change the style is by forking the extension.
The path to the theme style is specified in re-style/views/index.js
line 5.
I just fixed that in the latest beta. Now my initial suggestion should work. The URL of the inner frames now mostly matches the one of the outer window.
You could add an additional detection though, so that one could restyle reStyle without having to restart the browser repeatedly.
So far I have done this:
Notably I can't find the proper elements for sidebar and inputs, or the ones I found just don't work.
I've put your code as CSS in a <details>
tag.
The colors for the input elements are below the /* inputs */
comment.
Yes. This does not include the selectors for the tab sidebar (but the style is still applied to that page so it will look totally messed up). I'd ask you to just ignore that for now, or additional selectors at the bottom (but that may be difficult to isolate against the rest of the styles and to pick apart later).
Some weird exception how the styles are applied for this extension compared to all others would be ..., well weird.
Besides, the "Chrome debugging" mechanism works if you edit the page from the extension debugger (about:debugging
):
I took your version, took care of some rules you missed, adjusted a few others and also slightly modified the styles in general (especially the checkboxes).
The result looks pretty similar to Firefox' light (default) theme. It can currently be toggled in the Internal
section on the options page and should apply immediately to all open views (but only to the "main" views, not to the panel and some other things).
I guess I'll move the option to toggle it to a more prominent location together with some other UI improvements I am planning (some of which sou suggested as well). As for the panel, I could probably just not invert its colors for the light theme (and maybe pick a different background). But that is subject to changes anyway. Unfortunately I don't think that there is currently a way to detect which of the pre-installed Firefox themes is active. I would be nice to have an "auto" (default) option.
If you have any additional suggestions, please feel fee to comment. Otherwise you could close this.
The result looks pretty similar to Firefox' light (default) theme.
Yup, that's what I was aiming for.
As for the panel, I could probably just not invert its colors for the light theme (and maybe pick a different background). But that is subject to changes anyway.
Yeah, would make sense to change it before theming it.
Unfortunately I don't think that there is currently a way to detect which of the pre-installed Firefox themes is active. I would be nice to have an "auto" (default) option.
I think this is it: https://developer.mozilla.org/en-US/docs/Mozilla/Add-ons/WebExtensions/API/theme/getCurrent
I'll check the theme out later today and let you know if there are any problems with it.
I think this is it: https://developer.mozilla.org/en-US/docs/Mozilla/Add-ons/WebExtensions/API/theme/getCurrent
Yeah, event though I didn't see it on MDN, I read somewhere that is only works for themes added to Firefox, i.e. not for the three default themes. And in my short test with the dark theme enabled it did indeed just return an empty object.
I expect that to be the most common dark theme, so this API is actually rather useless.
Tested the theme now, and it looks great!
I prefer white backgrounds on my browser, so would be nice if reStyle had an option to toggle the theme.