Optional
initial?: booleanInitial 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
Optional
persist?: booleanPersist the dark mode preference to localStorage
Optional
selector?: stringThe selector to set color-scheme
property
Defaults to :root
. If set to empty string, CSS will not be updated
Option for initializing dark mode