document.addEventListener("DOMContentLoaded", () => { const commandBar = document.querySelector("command-bar"); commandBar.addEventListener("setOption", event => { console.log("SetOption", event); switch (event.option) { case "bg": case "background": const value = event.newValue; if (value === "dark" || value === "light") { document.querySelector(":root").setAttribute("color-scheme", value); } break; } }); });