@outbook/lumin-mystic
v3.0.1
Published
Light/Dark management
Readme
Lumin Mystic
Important: from versión 2 there is no backwards compatibility with previous versions.
Init LuminMystic:
import { LuminMystic } from '@arr2019/lumin-mystic';
const myAmbientHandler = new LuminMystic({
storageContext: 'local', // local | session
classDark: 'is-dark', // dark ambient class
eventFn: () => true // function for change ambient event
});
myAmbientHandler.init(); // init ambient handlerGet constants:
myAmbientHandler.AMBIENT_SELECTED // get current selected ambient
myAmbientHandler.AMBIENT_LIGHT // light ambient constant
myAmbientHandler.AMBIENT_DARK // dark ambient constant
myAmbientHandler.AMBIENT_AUTO // auto ambient constantSet ambient:
myAmbientHandler.setAmbient({ ambient: myAmbientHandler.AMBIENT_DARK }); // set ambient
