()
| 76 | |
| 77 | // Function to check system preference for dark mode |
| 78 | const getSystemPreference = (): "dark" | "light" => { |
| 79 | if (typeof window === "undefined") { |
| 80 | return "dark"; // Default for SSR |
| 81 | } |
| 82 | |
| 83 | return window.matchMedia?.("(prefers-color-scheme: dark)").matches |
| 84 | ? "dark" |
| 85 | : "light"; |
| 86 | }; |
| 87 | |
| 88 | // biome-ignore lint/complexity/noExcessiveCognitiveComplexity: theme initialization handles many CSS variable mappings |
| 89 | export const initEditorTheme = () => { |