according to request for seven phases max; in your node backend let say express
var less = require('less');
....
from your page you make an asynchronous request with the actual color of your page, just grab it by js and make a request. then in the expression:
app.post('/whateveryourroute', function(req, res) {
var colorFromReq = req.body.color;
less.render('.class { color: darken(`colorFromReq`, 20%) }', function (e, css) {
res.header("Content-type", "text/css");
res.send(css);
});
});
Something like this would be, not tested, but possible.
source
share