@media (prefers-color-scheme:dark){body{filter:invert(1) hue-rotate(180deg)}}
@media (prefers-color-scheme: dark) { body { background: #222222; filter:invert(1) hue-rotate(180deg) brightness(0.9) } }
Had the same problem, changed "body" to "html", added background: #fff, now it works.
I turned it into a bookmarklet to make it easy to use on any website:
javascript:styles='html {filter: invert(1) hue-rotate(180deg) brightness(.9); background-color: #fff; }'; newSS = document.createElement('style'); newSS.type = 'text/css'; newSS.innerHTML = styles; document.documentElement.getElementsByTagName('head')[0].appendChild(newSS);void(0);