Adds consultation leads, section editors, and the one-time content reset for this release. Co-authored-by: Cursor <cursoragent@cursor.com>
23 lines
639 B
TypeScript
23 lines
639 B
TypeScript
const STORAGE_KEY = "montech_theme";
|
|
|
|
/** The initial class is applied by the inline boot script in `nuxt.config.ts` before first paint. */
|
|
export function useTheme() {
|
|
const isDark = useState("theme-dark", () => false);
|
|
|
|
function sync() {
|
|
isDark.value = document.documentElement.classList.contains("dark");
|
|
}
|
|
|
|
function toggle() {
|
|
isDark.value = !isDark.value;
|
|
document.documentElement.classList.toggle("dark", isDark.value);
|
|
try {
|
|
localStorage.setItem(STORAGE_KEY, isDark.value ? "dark" : "light");
|
|
} catch {
|
|
/* storage unavailable (private mode) */
|
|
}
|
|
}
|
|
|
|
return { isDark, sync, toggle };
|
|
}
|