twitter-bootstrap Lesscss > 引导程序的 darken() 和 lighten() 无法编译
声明:本页面是StackOverFlow热门问题的中英对照翻译,遵循CC BY-SA 4.0协议,如果您需要使用它,必须同样遵循CC BY-SA许可,注明原文地址和作者信息,同时你必须将它归于原作者(不是我):StackOverFlow
原文地址: http://stackoverflow.com/questions/15173360/
Warning: these are provided under cc-by-sa 4.0 license. You are free to use/share it, But you must attribute it to the original authors (not me):
StackOverFlow
Lesscss > bootstrap's darken() and lighten() don't compile
提问by user1670816
My Less files aren't compiling as they should. I'm using the Bootstrap less files, most recent ones.
我的 Less 文件没有按照应有的方式编译。我正在使用 Bootstrap 较少的文件,最新的文件。
It looks like the less-files are failing because of the darken() and lighten() classes.
看起来由于 darken() 和 lighten() 类,less-files 失败了。
The error is:
错误是:
lessc fatal error: expected color value: failed at
background-color: darken(@inputBackground, 1%);/Applications/MAMP/htdocs/foobar/application/less/forms.less on line 195
lessc 致命错误:预期颜色值:
background-color: darken(@inputBackground, 1%);在第 195 行的 /Applications/MAMP/htdocs/foobar/application/less/forms.less 处失败
When I go to that line, I find the darken() of lighten(), remove that and the error is gone. But a new error appears, also a line with the darken() of lighten() class. Strange, right, or isn't it? Is there a fix someone knows about? Because I don't wanna remove the lighten() and darken() everywhere, they're the nicest functions in Bootstrap less!
当我转到那一行时,我找到了 lighten() 的 darken(),将其删除,错误就消失了。但是出现了一个新错误,也是与 lighten() 类的 darken() 一行。奇怪,对不对?有没有人知道的修复?因为我不想到处删除 lighten() 和 darken(),所以它们是 Bootstrap 中最好的函数!
Saved the files to UTF8 without BOM already in SublimeText2
将文件保存到 UTF8 没有 BOM 已经在 SublimeText2
Edit: strange, it works when it's on my NAS. Not local on my MacBook.. Is it a OSX issue?
编辑:奇怪,当它在我的 NAS 上时它可以工作。在我的 MacBook 上不是本地的。这是 OSX 问题吗?
回答by user2616862
My problems were solved once I changed the order of less file @import rules. The colour definition should be parsed before darken() is called.
一旦我更改了 less 文件 @import 规则的顺序,我的问题就解决了。颜色定义应该在调用 darken() 之前解析。

