vuejs / vitepress

Vite & Vue powered static site generator.
https://vitepress.dev
MIT License
13.22k stars 2.13k forks source link

use `usePreferredDark` with `appearance: "force-auto"` #4263

Closed mbostock closed 1 month ago

mbostock commented 1 month ago

Description

The appearance: "force-auto" implemented in #3946 1e8bb48 has a small bug where if the user had previously set the preferred color scheme using the appearance toggle, then useDark would retain that preference from local storage rather than respecting the system color scheme. This switches to usePreferredDark for "force-auto", thereby ignoring whatever is (or was) in local storage and always respecting the system color scheme.

Linked Issues

3946

Additional Context


[!TIP] The author of this PR can publish a preview release by commenting /publish below.