 setPreference = () => {
    localStorage.setItem(storageKey, theme.value);
    applyPreference();
  };
  const onClick = () => {
    theme.value = theme.value === "light" ? "dark" : "light";
    setPreference();
  };
  if (localStorage.getItem(storageKey) == null) {
    //set default theme if no preference is set
    theme.value = "dark";
    setPreference();
  }
  applyPreference();
  window.onload = () => {
    applyPreference();
    document.querySelector("#theme-toggle").addEventListener("click", onCli