mirror of
https://github.com/welpo/tabi.git
synced 2025-10-11 07:46:15 +02:00

Refactor the theme initialization script to use 'const' instead of 'let' for the 'currentTheme' variable, as the value is not expected to change after initialization. This makes the code more clear and prevents accidental re-assignment.
1 line
254 B
JavaScript
1 line
254 B
JavaScript
!function(){const e=localStorage.getItem("theme");if(e)document.documentElement.setAttribute("data-theme",e);else{const t=window.matchMedia("(prefers-color-scheme: dark)").matches;document.documentElement.setAttribute("data-theme",t?"dark":"light")}}();
|