I am trying to use less.js to make modifications to a less stylesheet for demonstration purposes. What I would like it to do is remember previous changes so I only have to send a single change each time for efficiency. Let's say I have the following:
@PrimaryColor: #FFF;
@SecondaryColor: #000;
If I change one parameter, it works fine.
less.modifyVars({ "@PrimaryColor": "#ff0000" });
The colors now look like this:
@PrimaryColor: #ff0000;
@SecondaryColor: #000;
Now if I call the method again:
less.modifyVars({ "@SecondaryColor": "#00ff00" });
The primary color switches back and the secondary color changes:
@PrimaryColor: #FFF;
@SecondaryColor: #00ff00;
My question is whether there is a way or a method that will just change the one parameter and leave the other changes alone?