Skip to content

usePreferredDark

Category
Export Size
592 B
Last Changed
5 days ago
Related

Reactive prefers-color-scheme: dark media query

Demo

Usage

tsx
import { 
usePreferredDark
} from '@reause/core'
const
isDark
=
usePreferredDark
() // boolean
// `true` while the user prefers a dark theme, flips live with the OS setting

Type Declarations

ts
export function usePreferredDark(options?: ConfigurableWindow): boolean

Source

Source · Demo · VueUse

Contributors

hairyf

Changelog

v0.1.0 on
8a2dc - fix(core): resolve usePreferredDark audit findings (#622)

Released under the MIT License. v0.1.8