Configure Vercel deployment and preserve deployed theme support

This commit is contained in:
StormRunner06106
2026-09-13 14:56:10 -07:00
parent d52495945b
commit cb8d062481
27 changed files with 610 additions and 60 deletions
+15
View File
@@ -0,0 +1,15 @@
// Apply before the stylesheet loads to avoid a light flash on dark-mode visits.
(() => {
let preference;
try {
preference = localStorage.getItem("portfolio-theme");
} catch {
// Theme selection still works when browser storage is unavailable.
}
const theme = preference === "light" || preference === "dark"
? preference
: window.matchMedia("(prefers-color-scheme: dark)").matches ? "dark" : "light";
document.documentElement.dataset.theme = theme;
document.documentElement.style.colorScheme = theme;
document.querySelector('meta[name="theme-color"]')?.setAttribute("content", theme === "dark" ? "#141d19" : "#f7f8f4");
})();