less / less.js

Less. The dynamic stylesheet language.
http://lesscss.org
Apache License 2.0
17.02k stars 3.41k forks source link

is there a way to prevent evaluation of "${prop}"? #3485

Closed forceuser closed 4 years ago

forceuser commented 4 years ago

is there a way to prevent evaluation of "${prop}"?

i need to pass generated css to template engine that uses ${} syntax for template interpolation, but i cant make less to generate string value like for example

background: url("${resourcesPath}img/123");
charsboo commented 4 years ago

Hi, @forceuser:

Does this work?

background: e(%('url("%s{resourcesPath}img/123")', "$"));
forceuser commented 4 years ago

thanks a lot, it realy works 👍