m-khvoinitsky / dark-background-light-text-extension

Firefox addon that turns every page colors into "light text on dark background"
Mozilla Public License 2.0
361 stars 27 forks source link

Put an attribute to <html> which indicates currently used method to allow users to use it in selectors in userstyles #194

Open ghost opened 6 years ago

ghost commented 6 years ago

I would like to further customize pages based on one of this extension's presets.

Ideally if the extension is configured and enabled for a specific page with a preset like "default", you could add custom CSS styles to it which are appended after "default" preset. If the extension is disabled for the page, these styles also should not be loaded (because they are built on top of a dark theme).

An example would be github.com itself. I think , the dark "default " theme for it is very cool, but I dislike these nasty white border grid lines and rather would set them in more grey tone 🙂

image

Are you planning to incorporate such a feature ? Or can you recommend an alternative solution?

Greetings

jkemp814 commented 6 years ago

I agree with this request also. The white border lines are too much contrast. If the border has to be displayed it should be grey, in my opinion.

m-khvoinitsky commented 6 years ago

See #125 for borders.

Let users further customize page css

I don't want to do this. There is Stylus which does it better. However:

If the extension is disabled for the page, these styles also should not be loaded

This of course won't work with Stylus, probably it makes sense to add some attribute to <html> to indicate which method currently is in use so users would be able to use it in selectors.

hklene commented 5 years ago

I was trying https://www.w3schools.com/jsref/jsref_getcomputedstyle.asp to find out if the background color is black or white. But it's always reported as plain white and does not reflect the status of this addon. Is this some kind of security feature so servers cannot identify and trac users by checking for effects of installed addons?

Is there any guideline, how to design / colorize a website to be easily compatible with your addon and look good by default?

m-khvoinitsky commented 5 years ago

I was trying https://www.w3schools.com/jsref/jsref_getcomputedstyle.asp to find out if the background color is black or white. But it's always reported as plain white and does not reflect the status of this addon. Is this some kind of security feature so servers cannot identify and trac users by checking for effects of installed addons?

Well, it shouldn't. I would actually happy do do something like this (preventing website from knowing whether user uses my add-on or not and knowing theirs preferences) to eliminate tracking and bugs like #153 but I can't. What exact code are you using? And what add-on's method you're trying to detect?

Is there any guideline, how to design / colorize a website to be easily compatible with your addon and look good by default?

For now, no. Probably, it should be. Add-on's approach always was trying to adapt to existing web, not vice-versa. Some hints from the top of my head: