switchery
switchery copied to clipboard
Add `is-selected` class when switch is ON
Hi,
Great work on switchery! Thanks!
I'm using SASS for my CSS and along with it, I've got some branding colors set through SASS variables. I'd like to be able to set the switch class when it's ON so that I can customize that particular class in my SASS like this:
.switchery.is-selected {
background-color: $brand-main;
}
Is this possible?
Currently, this is how I have it set:
new Switchery(this, { color: '#7ee1c4' });
Notice how now I have the main color specified in two places: once for $brand-main in SASS and once as a 'magic value' in the middle of my javascript code.
Thanks! Viktor