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

Firefox Color support #9

Closed
Keith94 opened this issue Sep 1, 2018 · 16 comments
Closed

Firefox Color support #9

Keith94 opened this issue Sep 1, 2018 · 16 comments
Labels
enhancement New feature or request

Comments

@Keith94
Copy link

Keith94 commented Sep 1, 2018

Not sure if it makes sense to support Firefox Color, but I thought I'd raise the issue anyway; the issue being that some of the pre-selected themes don't play nice with this theme.

@muckSponge
Copy link
Owner

It could be difficult but not impossible. In order to support both Firefox Color colours and Chrome colours I'd need rethink the way I enforce the Chrome colours (I currently override the CSS vars). I'd probably need to create a Firefox Color theme with Chrome colours, but I'm not sure if this would be comprehensive enough.

I'll stick a pin in it for now. Currently just trying to get the standard themes working without losing the Chrome colours.

@muckSponge
Copy link
Owner

Looks like it wouldn't be possible to perfectly match the Chrome colours with Firefox Color. If you decode the URLs with json-url you'll notice you can only change 7 colours (well, I guess you can infer that from the UI too), but with some carefully arranged CSS you could get 90% of the way there. It will no longer respect the dark colour scheme in private browsing mode so I'm hesitant to go any further right now.

@Keith94
Copy link
Author

Keith94 commented Sep 1, 2018

Sounds tricky! That's OK if it can't be helped. Just wanted to bring it to your attention. :)

@muckSponge muckSponge added the enhancement New feature or request label Sep 3, 2018
@muckSponge
Copy link
Owner

Started to address this in 166c6ad. Basically how it will work is, this theme will for the most part not enforce any specific colours - it will leave this up to the current Firefox theme, which would be Default, Light, Dark, or a custom theme. To make life easier, a Firefox add-on will be used to manage switching between the default themes, installed custom themes, and a Material Light and Material Dark theme embedded in the add-on itself. The Material Dark theme will be forced on when in private browsing mode. I'll maintain the Firefox add-on in a separate repository and it will be optional (but recommended).

See theme-compatibility branch (still a work in progress).

@Keith94
Copy link
Author

Keith94 commented Sep 22, 2018

Cool! That seems promising indeed.

@muckSponge
Copy link
Owner

Could you try out MaterialFox Helper with the theme-compatibility branch and let me know how it goes? The theme should now be fully compatible with Firefox Color, regardless of whether you use the helper.

Due to the complex way in which themes can be installed (either via theme extensions or add-ons which directly modify the theme), it is quite difficult for the add-on to know exactly what theme is enabled so it might sometimes say a theme is enabled but in fact another add-on (like Firefox Color) is overriding it. This is evident if you select a theme in the MaterialFox Helper button, then open up Firefox Color and select a preset in there. The helper button isn't and can't be aware of the Firefox Color themes and will think you've still got the previous theme enabled. I'll make a few modifications later so it doesn't tell you a theme is enabled when it has actually been overridden.

@Keith94
Copy link
Author

Keith94 commented Sep 23, 2018

I will check it ASAP.

@muckSponge
Copy link
Owner

Thanks! One thing I neglected to think about is the fact that the add-on doesn't store any settings so the theme will reset after restarting the browser. Will hopefully have this fixed in the next version.

@muckSponge
Copy link
Owner

Added persistent storage and improved compatibility with Firefox Color. It's still not perfect because I don't have access to Firefox Color's theme data - only current theme. Got a few ideas to improve it. Until then, select Default as theme and then set your colours with Firefox Color. If you change the theme again through MaterialFox Helper, you'll need to go and redo you Firefox Color selection.

@Keith94
Copy link
Author

Keith94 commented Sep 23, 2018

I did a quick test; overall looks much better, although I noticed some themes are a little bugged whereby the address bar can be unreadable (light text on light background, etc.).

image

@muckSponge
Copy link
Owner

Interesting! Thanks for trying it out. Looks like I need to force the urlbar text colour to ensure it is either light or dark, and not leave it up to the theme to set it directly. Thought I was already doing this but must have missed something.

The way it worked on Chrome when I tested was it either picks the regular light urlbar or dark urlbar and themes aren't allowed to affect it other than telling it to be the light or dark variant, and this is what I'm aiming for.

@jcruzs
Copy link

jcruzs commented Sep 30, 2018

I'm using vivaldifox for the moment and it seems to be working nice. I not sure how the extensions apply the colors but is working great in case you want an extensions that adapt the color from the site you visit like vivaldi browser.

muckSponge added a commit that referenced this issue Oct 3, 2018
@muckSponge
Copy link
Owner

Should work even better with the windows-improvements branch. Just need to improve light theme compatibility.

@Keith94
Copy link
Author

Keith94 commented Oct 3, 2018

@muckSponge
Copy link
Owner

muckSponge commented Oct 4, 2018

Thanks @Keith94. V2 should not affect compatibility, just adds more customisation. The thing MaterialFox doesn't let you specifically change is the urlbar background and text colour, keeping in line with Chrome.

@muckSponge
Copy link
Owner

Haven't done anything to improve light theme compatibility but I think it's good enough to merge into master. Will mark this as closed now, all theme compatibility changes are in master.

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

No branches or pull requests

3 participants