I saw a tweet about LESS CSS today that I was able to answer with some simple trials. The question came from @funkatron: “Can any LESS.js nerds tell me how I could use a variable to set a base path for various `url()`s? like `background: url(@BASEPATH/foo.png)`”
The solution was quite simple after some trial and error.
@BASEPATH: ‘/PATH/TO/BASE’;
#element {
url({@BASEPATH}/foo.png);
}
Turns out it doesn’t work in lessc. I use PHP Less CSS. (plessc)
One reply on “LESS CSS Strings”
Just started playing with LESS the other day, and have now implemented plessc after coming across this post (looking for a solution for base path options.
Thanks!