PageSourceSearch

https://thepollyproject.org/assets/js/theme-toggle.js

js thepollyproject.org collected 2026-10-02 04:34:21 UTC 651 bytes, 19 lines download raw bytes

1(function () {
2  var STORAGE_KEY = "theme";
3  var button = document.querySelector(".theme-toggle");
4  if (!button) return;
5  button.addEventListener("click", function () {
6    var current = document.documentElement.getAttribute("data-theme");
7    var next = current === "dark" ? "light" : "dark";
8    document.documentElement.setAttribute("data-theme", next);
9    localStorage.setItem(STORAGE_KEY, next);
10
11    var giscusFrame = document.querySelector("iframe.giscus-frame");
12    if (giscusFrame) {
13      giscusFrame.contentWindow.postMessage(
14        { giscus: { setConfig: { theme: next } } },
15        "https://giscus.app"
16      );
17    }
18  });
19})();

Line numbers count LF bytes from the start of the resource, as the search results do. Vendor segments are library code the classifier recognised; they are stored but not indexed. Bytes are shown as Latin1 characters, one per byte.