jasontbradshaw / amazon-wish-list-total

An extension that totals up the price of all items in the current Amazon wish list.
MIT License
36 stars 11 forks source link

Dark mode toggle #24

Open ArchOwlen opened 3 years ago

ArchOwlen commented 3 years ago

I use the Dark Reader extension to make websites dark, and it becomes hard to read when both extensions are enabled

image

(Small screenshot for privacy) (For those who are using a dark theme on github: there is a dark border around the white box in the screenshot)

jasontbradshaw commented 3 years ago

Dark mode isn't something I'm personally interested in, however if there was a low effort/maintenance way to support it passively (e.g. using different classes from Amazon's styles), I'd be open to a PR.

My main concern is that I don't want to do something specific to a particular extension since I don't want to commit to chasing cross-extension compatibility forever.

As for implementation details, essentially this extension uses Amazon's own class names to style most things (e.g. https://github.com/jasontbradshaw/amazon-wish-list-total/blob/98a23f04fbfd39907c33fcff36775c5b93d27357/main.js#L334-L345), with the exception of https://github.com/jasontbradshaw/amazon-wish-list-total/blob/98a23f04fbfd39907c33fcff36775c5b93d27357/main.css#L31.

If there's a way to get the "white opaque background" style by adding one of Amazon's class names to the appropriate element, it's quite possible that this could be implemented along the guidelines I suggested above, since presumably the dark mode extension would then override the style for that class make it "dark" (though as I'm not familiar with that extension so it may not work this way).