My lazy dark mode solution:
html.dark-mode { filter: grayscale(100%) invert(100%); }
html.dark-mode { filter: grayscale(100%) invert(100%); }
Note that the cost of this lazy method is very poor performance (css filter over the entire document), and lack of control over dark colours (inverted colours don't necessarily work best, shifting hue can help but you probably don't want the same as uninverted colours because they tend to be too dark and lack sufficient contrast).
Alternatively you can target elements individually, omitting images.