finishing up the implementation
This commit is contained in:
committed by
Samuel Newman
parent
139683fab1
commit
440fae6bc5
@@ -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)
|
||||
|
||||
Reference in New Issue
Block a user