less/less.ruby

define empty string variable

vol4ok opened this issue · 3 comments

I want to define a variable, which could be empty in some cases
@prefix: "";
and to use it like this
src: url("@{prefix}/path/to/something");
the problem is that it compiles into
src: url("""/path/to/something");

How to define an empty string variable, that can be compiled in
src: url("/path/to/something");

I have the same issue!
Try to use @Prefix: " ";

@prefix: "";
header {
    background: url('@{prefix}logo.png');
}

Works great for me. If that doesn't work you could change it to this which sets it to be empty with javascript.

@prefix: ~'';

I use:
@prefix: ;

and its empty :)