/** * ───────────────────────────────────────────── * SPB Git — Personal Git Platform * ───────────────────────────────────────────── * Author : Simon-Pierre Boucher * Contact : contact@spboucher.ai * File : src/web/assets/js/theme-boot.js * Purpose : Apply the persisted theme before first paint (no FOUC) * License : MIT © Simon-Pierre Boucher * ───────────────────────────────────────────── */ (function () { var stored = null; try { stored = localStorage.getItem('spbgit-theme'); } catch (e) { /* private mode */ } var theme = stored; if (theme !== 'dark' && theme !== 'light') { theme = matchMedia('(prefers-color-scheme: light)').matches ? 'light' : 'dark'; } document.documentElement.setAttribute('data-theme', theme); })();