mirror of
https://github.com/AmruthPillai/Reactive-Resume.git
synced 2025-11-13 08:13:49 +10:00
refactor(v4.0.0-alpha): beginning of a new era
This commit is contained in:
14
apps/client/public/scripts/initialize-theme.js
Normal file
14
apps/client/public/scripts/initialize-theme.js
Normal file
@ -0,0 +1,14 @@
|
||||
(function initializeTheme() {
|
||||
try {
|
||||
if (
|
||||
localStorage.theme === "dark" ||
|
||||
window.matchMedia("(prefers-color-scheme: dark)").matches
|
||||
) {
|
||||
document.documentElement.classList.add("dark");
|
||||
} else {
|
||||
document.documentElement.classList.remove("dark");
|
||||
}
|
||||
} catch (_) {
|
||||
// pass
|
||||
}
|
||||
})();
|
||||
Reference in New Issue
Block a user