@sagemodeninja/color-scheme-provider
v2.0.0
Published
A library for managing and tracking preferred color schemes in web applications, with automatic detection, customization options, and subscription-based notifications.
Downloads
41
Readme
Color Scheme Provider
A library for managing and tracking preferred color schemes in web applications, with automatic detection, customization options, and subscription-based notifications.
Documentation
See the wiki for guides on how to use the components.
Or, see the demo site for examples and demos.
v2.* Breaking Changes
ColorSchemeProvider Members
- Deprecated
preferredColorSchemeandcolorSchemeproperties.- Subscribers are notified and given a
schemeparameter with a value equivalent to thecolorSchemeproperty. - Use asynchronous
updatefunction to update schemes, this is equivalent to setting a value topreferredColorScheme.
- Subscribers are notified and given a
- Renamed
subscribeNotificationtosubscribe. - Callback for
subscribenow has aschemeparameter.
Behavior
- Subscribing will now trigger an initial callback with the latest scheme value as a parameter.
- The
subscribe,toggleand the newupdatefunctions is now asynchronous.
Installation
From within your project, run:
npm i @sagemodeninja/color-scheme-provider
Contributing
See CONTRIBUTING.md for more information.
Set up
Initialize repo:
git clone https://github.com/sagemodeninja/color-scheme-provider.git
cd color-scheme-providerInstall the necessary dependencies:
npm installRun a local demo:
npm start