I am not sure if this is possible. But the concept is similar to SASS variables, but uses jQuery instead. So let's say that I would like to use reusable CSS attributes for jQuery. For instance...
I want to make a variable that I can reuse for black
var black = .css('color','#000');
var white = .css('color','#FFF');
This obviously does not work, because the syntax is wrong ... but you get the picture, I hope ... So later I could do it ...
$('#myelement').css(black);
Is it possible to do something like this?
source
share