mirror of
https://github.com/arsvendg/Stirling-PDF.git
synced 2026-07-15 02:54:06 +02:00
# Description of Changes Refactor user preferences to all be in one service and all stored in localStorage instead of indexeddb. This allows simpler & quicker accessing of them, and ensures that they're all neatly stored in one consistent place instead of spread out over local storage.
9 lines
264 B
TypeScript
9 lines
264 B
TypeScript
// Theme constants and utilities
|
|
|
|
export type ThemeMode = 'light' | 'dark' | 'rainbow';
|
|
|
|
// Detect OS theme preference
|
|
export function getSystemTheme(): 'light' | 'dark' {
|
|
return window?.matchMedia?.('(prefers-color-scheme: dark)').matches ? 'dark' : 'light';
|
|
}
|