mirror of
https://github.com/kuhyx/utils.git
synced 2026-11-20 19:52:29 +01:00
Todo: 3a5477b9 Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
9 lines
417 B
JavaScript
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;
|
|
}
|