reddit-moderator-toolbox icon indicating copy to clipboard operation
reddit-moderator-toolbox copied to clipboard

Make toolbox work with reddit dark mode

Open creesch opened this issue 3 years ago • 1 comments

See the title. The other day I noticed that there is an explicit class used by reddit for their dark mode. It even is the same class as they use in modmail.

However in modmail they add it to the body element and for the rest of reddit they add it to the html element.

I opted to simply add our class to the html element as well because I didn't feel like adding a bunch of css selectors.

creesch avatar Oct 19 '22 14:10 creesch

I guess related to #486 but we still might want to also make it an option.

creesch avatar Oct 19 '22 14:10 creesch

This has the potential to break some user CSS that assumes .mod-toolbox-rd can only exist on body, e.g. .mod-toolbox-rd:not(.some-other-body-class) will now always match since html and body don't get the same classes in general. The fix is for people to use body.mod-toolbox-rd:not(...) instead.

We don't appear to use this pattern in Toolbox code, and the fix for any stylesheets this does break is pretty simple, so I'm fine with merging this.

eritbh avatar Oct 25 '22 02:10 eritbh