Skip to main content

read_system_dark

Function read_system_dark 

Source
fn read_system_dark() -> bool
Expand description

读取当前系统是否为深色偏好。

WASM 端通过 matchMedia('(prefers-color-scheme: dark)') 读取;SSR 端拿不到 客户端系统偏好,返回 false(首屏由 ThemePreload 脚本客户端纠正)。