Darkmode.js icon indicating copy to clipboard operation
Darkmode.js copied to clipboard

Overwriting css property using .darkmode--activated class is not working

Open sebakthapa opened this issue 4 years ago • 4 comments

Overwriting CSS property using .darkmode--activated class is not working and also overwriting class attributes too are not working.

sebakthapa avatar Jan 17 '21 02:01 sebakthapa

I tried to ignore some elements for dark mode using all the options I found:

  • Use the class darkmode-ignore where you don't want to apply darkmode
  • You can also add this style: isolation: isolate; in your CSS, this will also ignore the darkmode.
  • A CSS class darkmode--activated is added to the body tag when the darkmode is activated. You can take advantage of it to override the style and have a custom style

None of the above worked, I loaded Darkmode.js with CDN.

  • It is also possible to revert the Dark Mode with this style mix-blend-mode: difference;

This one above did some weird things and pulled out colors, at least it did something I guess? Not what I was expecting though.

Would be really lovely if this issue could get resolved so this can actually be used.

kenjibailly avatar Mar 12 '21 16:03 kenjibailly

I think the option that works the best is:

  • applying mix-blend-mode: difference; style on the items where the color is reversed. does it work?

sandoche avatar Apr 14 '21 16:04 sandoche

Have you tried this? https://github.com/sandoche/Darkmode.js/issues/60

sandoche avatar Apr 14 '21 16:04 sandoche

I found that there is no single solution, basically you need to read and understand what "mix-blend-mode" does and how it interacts with various elements.

There I made it work as userscript -> https://github.com/Purfview/Darkmode-User You can find there hints what worked or use it for quick testing with few tweaks to it.

Purfview avatar Apr 23 '21 09:04 Purfview