I think this is not possible, but I thought I ask in case there is a way. The idea is that I have a variable for path to web resource folder:
@root: "../img/";
@file: "test.css";
@url: @root@file;
.px {
background-image: url(@url);
}
I get this as a result:
.px { background-image: url("../img/" "test.css"); }
But, I want the strings to combine into one string like this:
.px { background-image: url("../img/test.css"); }
Is it possible to concatenate strings together in Less?
Using Drupal 7. I've used an ordinary plus mark and it's working:
Use Variable Interpolation:
Full code:
I was looking for the same trick for handling images. I used a mixin to answer this:
Then you can use :
or
As you can see in the documentation, you can use string interpolation also with variable and plain strings together:
For those string-like unit values like
45deg
intransform: rotate(45deg)
use theunit(value, suffix)
function. Example:Don't know if you're using less.js or lessphp (like in WP-Less plugin for WordPress) but with lessphp you can "unquote" strings with
~
: http://leafo.net/lessphp/docs/#string_unquoting