.css File
@media (prefers-color-scheme: dark) {
:root {
color-scheme: light dark;
filter: invert(100%);
-webkit-filter: invert(100%)
}
}
This how it looks in WKWebView
After adding the table tag, table data color inverted properly
@media (prefers-color-scheme: dark) {
// root tag inverting all the components color except the table.
: root {
color-scheme: light dark;
filter: invert(100%);
-webkit-filter: invert(100%)
}
//table tag needed for inverting table content.
table {
filter: invert(100%);
}
}