Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

less css, define empty string variable

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");

Update: Issue closed https://github.com/cloudhead/less.js/issues/532

like image 289
vol4ok Avatar asked Dec 15 '11 10:12

vol4ok


1 Answers

Just found a way to do this... escape an empty string @prefix: ~'';

I ran into this with the box-shadow inset option that will often remain empty.

like image 112
Tyler Avatar answered Nov 15 '22 07:11

Tyler