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 https://vueuse.org/usePreferredColorScheme
* @param [options]
*/
export declare function usePreferredColorScheme(
options?: ConfigurableWindow
): ComputedRef<ColorSchemeType>