- #21
4ad51dcThanks @rqbazan! - Restructure the README, with the name linked to the Project page and the development notes moved to the repository's development guide, and namercrd <ricardo@variable.land>in the LICENSE.
- #14
6cc642dThanks @rqbazan! - Put the Sign and the Tagline at the top of the README, and set the author torcrd <ricardo@variable.land>.
-
#8
48299eeThanks @rqbazan! - Renamed from@vlandoss/theme-toggle. The package now lives at withvariablelab/theme-toggle;@vlandoss/theme-togglewill not receive further releases.Breaking changes
- Install and import
@variablelab/theme-toggleinstead of@vlandoss/theme-toggle(the inline script moves tohttps://unpkg.com/@variablelab/theme-toggle/dist/initial.js). - The
localStoragekey is now@variablelab/theme-toggle.colorMode(was@vlandoss/theme-toggle.colorMode). - The change event is now
@variablelab/theme-toggle.colorModeChange(was@vlandoss/theme-toggle.colorModeChange). Update anydocument.addEventListener(...)listeners, or read the name fromwindow.__COLOR_MODE__.CUSTOM_EVENT.
Automatic migration
Users keep their saved color mode. On init, both the inline script and
useColorModecheck for the 1.x key: if@variablelab/theme-toggle.colorModeis absent and@vlandoss/theme-toggle.colorModeexists, its value is copied to the new key. A value already stored under the new key always wins. Either way, the old key is removed. - Install and import
- #2
dd42ff8Thanks @rqbazan! - Initial stable release. Ships theuseColorModeReact hook and an inline pre-paint script forlight/dark/systemcolor modes. Thesystemmode resolves against the OSprefers-color-schemeand tracks it live, the choice is persisted tolocalStorage, adarkclass is toggled on<html>, and aCustomEventis dispatched on every change.