SettingsScreen CC 23 -> below 10. Form parsing, change detection and the dark-theme check moved to utils/ with unit tests; the dark switch now reads the OS scheme instead of comparing the background colour. Adds characterization tests for the screen.
8 lines
301 B
TypeScript
8 lines
301 B
TypeScript
/** Whether the dark theme is in effect for a stored preference and the OS scheme. */
|
|
export function isDarkTheme(
|
|
preference: 'light' | 'dark' | 'system',
|
|
systemScheme: 'light' | 'dark',
|
|
): boolean {
|
|
return preference === 'dark' || (preference === 'system' && systemScheme === 'dark');
|
|
}
|