mirror of
https://github.com/elk-zone/elk.git
synced 2024-11-02 23:19:57 +00:00
15 lines
382 B
TypeScript
15 lines
382 B
TypeScript
|
import { InjectionKeyColorMode, InjectionKeyFontSize } from '~/constants/symbols'
|
||
|
|
||
|
export function useFontSizeRef() {
|
||
|
return inject(InjectionKeyFontSize)!
|
||
|
}
|
||
|
|
||
|
export function useColorModeRef() {
|
||
|
return inject(InjectionKeyColorMode)!
|
||
|
}
|
||
|
|
||
|
export function toggleColorMode() {
|
||
|
const colorMode = useColorModeRef()
|
||
|
colorMode.value = colorMode.value === 'light' ? 'dark' : 'light'
|
||
|
}
|