Darkreader is a magic plugin that adds styles to web pages to discover the implementation principle using CSS filters

body{
    filter: invert(100%) hue-rotate(180deg) brightness(115%) contrast(95%) ! important;
}
Copy the code

The above code reverses most cases

Some special cases need to be handled. If you need to add dark mode switch to the site, please refer to.