Closed jlangston closed 12 years ago
I figured out a way to do this using the java method call feature
public static String getCssBaseImgUri(String img)
{
return "'" + cssBaseImgUri + img + "'";
}
cssBaseImgUri is a Static string which is the base image path for all the css images
@setImgPath(@imgName): @import packagepath.Class#getCssBaseImgUri;
body {
background-image: url(@setImgPath(BodyBg.gif));
}
This issue should really be re-opened, since it's such a common requirement. Having to write custom Java code is quite off-putting.
With Less embedding a variable in a string is pretty easy with the @{token} syntax. Is there already a similar method to do this in zuss?
Less Example