finishing up the implementation

This commit is contained in:
kakkokari-gtyih
2024-12-01 11:43:55 +09:00
committed by Samuel Newman
parent 139683fab1
commit 440fae6bc5
3 changed files with 20 additions and 8 deletions
+6
View File
@@ -1,3 +1,9 @@
export type ColorModeValues = 'auto' | 'light' | 'dark'
export function assertColorModeValues(value: string): value is ColorModeValues {
return ['auto', 'light', 'dark'].includes(value)
}
export function applyTheme(theme: 'light' | 'dark') {
document.documentElement.classList.remove('light', 'dark')
document.documentElement.classList.add(theme)