Preferred Color Scheme:
no-preference
usePreferredColorScheme
Reactive prefers-color-scheme media query.
Usage
import { usePreferredColorScheme } from '@vueuse/core'
const preferredColor = usePreferredColorScheme()
Component
<UsePreferredColorScheme v-slot="{ colorScheme }">
Preferred Color Scheme: {{ colorScheme }}
<UsePreferredColorScheme>
Type Declarations
export declare type ColorSchemeType = "dark" | "light" | "no-preference"
/**
* Reactive prefers-color-scheme media query.
*
* @see /usePreferredColorScheme
* @param [options]
*/
export declare function usePreferredColorScheme(
options?: ConfigurableWindow
): ComputedRef<ColorSchemeType>