Skip to content

Latest commit

 

History

History
35 lines (19 loc) · 2.75 KB

CHANGELOG.md

File metadata and controls

35 lines (19 loc) · 2.75 KB

@variablelab/theme-toggle

2.0.2

Patch Changes

  • #21 4ad51dc Thanks @rqbazan! - Restructure the README, with the name linked to the Project page and the development notes moved to the repository's development guide, and name rcrd <ricardo@variable.land> in the LICENSE.

2.0.1

Patch Changes

  • #14 6cc642d Thanks @rqbazan! - Put the Sign and the Tagline at the top of the README, and set the author to rcrd <ricardo@variable.land>.

2.0.0

Major Changes

  • #8 48299ee Thanks @rqbazan! - Renamed from @vlandoss/theme-toggle. The package now lives at withvariablelab/theme-toggle; @vlandoss/theme-toggle will not receive further releases.

    Breaking changes

    • Install and import @variablelab/theme-toggle instead of @vlandoss/theme-toggle (the inline script moves to https://unpkg.com/@variablelab/theme-toggle/dist/initial.js).
    • The localStorage key 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 any document.addEventListener(...) listeners, or read the name from window.__COLOR_MODE__.CUSTOM_EVENT.

    Automatic migration

    Users keep their saved color mode. On init, both the inline script and useColorMode check for the 1.x key: if @variablelab/theme-toggle.colorMode is absent and @vlandoss/theme-toggle.colorMode exists, 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.

1.0.0

Major Changes

  • #2 dd42ff8 Thanks @rqbazan! - Initial stable release. Ships the useColorMode React hook and an inline pre-paint script for light / dark / system color modes. The system mode resolves against the OS prefers-color-scheme and tracks it live, the choice is persisted to localStorage, a dark class is toggled on <html>, and a CustomEvent is dispatched on every change.