Category | Browser |
---|---|
Export Size | 570 B |
Last Changed | last year |
Reactive prefers-color-scheme media query.
import { usePreferredColorScheme } from '@vueuse/core' const preferredColor = usePreferredColorScheme()
This function also provides a renderless component version via the
@vueuse/components
package. Learn more about the usage.
<UsePreferredColorScheme v-slot="{ colorScheme }"> Preferred Color Scheme: {{ colorScheme }} </UsePreferredColorScheme>
export 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>
© 2019-present Anthony Fu
Licensed under the MIT License.
https://vueuse.org/core/usePreferredColorScheme/