utils/kuhy_credit/web/demo/theme.js
Krzysztof kuhy Rudnicki 50473d2d26 kuhy_credit: web element, Godot, Flutter, CI, README
Todo: 3a5477b9

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-11-20 15:33:19 +01:00

9 lines
417 B
JavaScript

// ?theme=light|dark forces both the page tokens and the credit's theme.
const theme = new URLSearchParams(location.search).get("theme");
if (theme === "light" || theme === "dark") {
document.documentElement.style.colorScheme = theme;
document.querySelector("kuhy-credit").setAttribute("theme", theme);
const surface = { dark: "#211d1b", light: "#f6f4f3" }[theme];
document.body.style.background = surface;
}