Interface DarkOptions

Source
Expand description

Option for initializing dark mode. See initDark

interface DarkOptions {
    initial?: boolean;
    persist?: boolean;
    selector?: string;
}

Properties§

§initial?: boolean

Initial value for dark mode

If not set, it will default to calling prefersDarkMode().

If persist is true, it will also check the value from localStorage

§persist?: boolean

Persist the dark mode preference to localStorage

§selector?: string

The selector to set color-scheme property

Defaults to :root. If set to empty string, CSS will not be updated