A library for managing and tracking preferred color schemes in web applications, with automatic detection, customization options, and subscription-based notifications.
See the wiki for guides on how to use the components.
Or, see the demo site for examples and demos.
- Deprecated
preferredColorScheme
andcolorScheme
properties.- Subscribers are notified and given a
scheme
parameter with a value equivalent to thecolorScheme
property. - Use asynchronous
update
function to update schemes, this is equivalent to setting a value topreferredColorScheme
.
- Subscribers are notified and given a
- Renamed
subscribeNotification
tosubscribe
. - Callback for
subscribe
now has ascheme
parameter.
- Subscribing will now trigger an initial callback with the latest scheme value as a parameter.
- The
subscribe
,toggle
and the newupdate
functions is now asynchronous.
From within your project, run:
npm i @sagemodeninja/color-scheme-provider
See CONTRIBUTING.md for more information.
Initialize repo:
git clone https://github.com/sagemodeninja/color-scheme-provider.git
cd color-scheme-provider
Install the necessary dependencies:
npm install
Run a local demo:
npm start