Skip to content

usePreferredColorScheme

Category
Export Size
366 B
Last Changed
5 days ago

Reactive prefers-color-scheme media query

Demo

Usage

tsx
import { 
usePreferredColorScheme
} from '@reause/core'
const
colorScheme
=
usePreferredColorScheme
() // 'dark' | 'light' | 'no-preference'

Type Declarations

ts
export type ColorSchemeType = 'dark' | 'light' | 'no-preference'

export function usePreferredColorScheme(options?: ConfigurableWindow): ColorSchemeType

Source

Source · Demo · VueUse

Contributors

hairyf

Changelog

v0.1.0 on
e45d4 - fix(core): resolve usePreferredColorScheme audit findings (#621)

Released under the MIT License. v0.1.8