在更少的CSS中转义整个声明 [英] escape whole declaration in less css
问题描述
是否可以转义整个声明? 这在less.js(我正在使用less.app)中符合要求
Is it possible to escape whole declaration? This complies fine in less.js (I'm using less.app)
margin: e(" 0 10px");
但这会引发错误:
e("margin: 0 10px");
我尝试将'margin'放入变量中,但没有成功.
I've tried putting 'margin' in a variable but without success.
推荐答案
抱歉,无法实现.不过有几件事:
Sorry that's not possible. A couple things though:
正式的转义符(根据 lesscss.org 是波浪号,而不是e()
语法,例如所以:
The official escape designation (according to lesscss.org is the tilde-quote, not the e()
syntax, like so:
margin: ~"0 10px";
第二,您提供的代码还不够复杂,不足以保证LESS CSS字符串文字.请分享遇到问题的实际代码.您可能需要关闭此问题并询问另一个问题.
Second, the code you provided is not nearly complex enough to warrant a LESS CSS string literal. Please share the actual code that you are having trouble with. You may want to close this question and ask another one.
第三,请记住,您可以包含一个.css文件-它不会被编译,只是转储到输出中.语法与标准CSS导入相同:
Third, remember that you can include a .css file - it will not be compiled, just dumped into the output. The syntax is identical to a standard CSS import:
@import "myfile.css";
这篇关于在更少的CSS中转义整个声明的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!