~james/core

core/docs/src/components/ThemeProvider.astro -rw-r--r-- 285 bytes
452f17b7 — james chore(import): snapshot james.dad.town/core at f70c71c7696a 15 hours ago
                                                                                
1
2
3
4
5
6
7
8
9
10
<script is:inline>
  (() => {
    const system = matchMedia("(prefers-color-scheme: dark)");
    const apply = () => {
      document.documentElement.dataset.theme = system.matches ? "dark" : "light";
    };
    apply();
    system.addEventListener("change", apply);
  })();
</script>