I created a global variable in LESS css and assigned it a value. I have used this value in several classes in CSS. I want to dynamically override this global variable through javascript.
@color: #f938ab;
body {
font-family: 'Raleway', sans-serif;
color: @color;
}
Is it possible to override the above variable using JavaScript code or something like below?
var color =
document.documentElement.style.setProperty('@color', color);
Or is there any other method in CSS?
source
share