function updateBody(theme) {
let elem = document.body;
+ elem.classList.remove('dark-theme');
+ elem.classList.remove('light-theme');
if (theme === 'dark') {
elem.classList.add('dark-theme');
}
- else {
- elem.classList.remove('dark-theme');
+ else if (theme === 'light') {
+ elem.classList.add('light-theme');
}
}
filter: invert(100%) hue-rotate(180deg) saturate(1.25);
}
}
+ /* These rules are for when the theme selector is used, perhaps in contrast to the browser theme. */
body.dark-theme polygon, body.dark-theme rect, body.dark-theme polyline, body.dark-theme line {
stroke: #ffffff;
}
body.dark-theme text {
fill: #ffffff;
}
+ body.light-theme polygon, body.light-theme rect, body.light-theme polyline, body.light-theme line {
+ stroke: #000000;
+ }
+ body.light-theme polygon.filled {
+ fill: #000000;
+ }
+ body.light-theme text {
+ fill: #000000;
+ }
</style>
<defs />