叽叽喳喳的“过滤器”不再令人窒息css 属性,其他杂项错误
我最近安装了 Visual Studio 2010 的 Chirpy v2.01,并对它提供的功能感到非常兴奋。然而,我在 LESS 域中遇到了一些问题。
第一步,我将现有的 .css 文件复制到新的 LESS 文件中。我立即收到两个错误。第一个是由于我设置的CSS“过滤器”属性:
div.someClass {
filter: progid:DXImageTransform.Microsoft.gradient(startColorstr='#aaaaaa', endColorstr='#000000');
}
这显然是因为过滤器值在技术上不是有效的CSS。 LESS 有一个解决方法,通过转义。在引用部分前面添加波浪号告诉 LESS 保持值不变。以下更改应该可以解决该问题:
div.someClass {
filter: ~"progid:DXImageTransform.Microsoft.gradient(startColorstr='#aaaaaa', endColorstr='#000000')";
}
保存文件后,我仍然在 Visual Studio 错误控制台中收到以下错误:
错误 54 在文件“C:\Users\Administrator\Projects\Project\Content\test.chirp.less”中的第 2 行应有“}”: [1]:正文{ [2]: 过滤器: ~"progid:DXImageTransform.Microsoft.gradient(startColorstr='#aaaaaa', endColorstr='#000000')"; ----^ [3]: } C:\Users\Administrator\Projects\Project\Content\test.chirp.less 2 5 项目
只要出现此错误,就永远不会生成 .css 文件。我遇到了 以下网站似乎描述了该问题我有,但在一个更通用的 DotLess .NET 包中。我尝试将此包添加到我的项目中,但没有什么区别。看起来它也依赖服务器来处理 .less 到 .css 的转换,而不是像 chirpy 那样依赖 IDE。
我经常收到的第二个错误如下,尽管它似乎并没有真正停止生成 .css 文件:
错误53致命错误,无法继续:null无法转换为对象C:\Users\Administrator\Projects\Project\Content\test.css 1 1 Project
我真的很喜欢使用 Chirpy 提供的 LESS 功能,但直到我可以弄清楚为什么会发生这些错误,我仅限于将它用于混搭。
I recently installed Chirpy v2.01 for Visual Studio 2010 and am very excited about the features it offers. I'm running into some issues in the LESS domain, however.
As a first step, I copied over my existing .css file to a new LESS file. I immediately am getting two errors. The first is due to a CSS "filter" property that I have set:
div.someClass {
filter: progid:DXImageTransform.Microsoft.gradient(startColorstr='#aaaaaa', endColorstr='#000000');
}
This apparently is because the filter value is not technically valid css. LESS has a workaround for this, via escaping. Adding a tilde in front of a quoted section tells LESS to keep the value as-is. The following change should resolve the issue:
div.someClass {
filter: ~"progid:DXImageTransform.Microsoft.gradient(startColorstr='#aaaaaa', endColorstr='#000000')";
}
Upon saving the file, I still receive an error in the visual studio error console along these lines:
Error 54 Expected '}' on line 2 in file 'C:\Users\Administrator\Projects\Project\Content\test.chirp.less':
[1]: body {
[2]: filter: ~"progid:DXImageTransform.Microsoft.gradient(startColorstr='#aaaaaa', endColorstr='#000000')";
----^
[3]: } C:\Users\Administrator\Projects\Project\Content\test.chirp.less 2 5 Project
The .css files are never generated so long as this error comes up. I came across the following site that seems to describe the issue I'm having, but in a more generic DotLess .NET package. I tried adding this package to my project, but it didn't make a difference. It also looks like it relies on the server to handle the .less to .css conversion, instead of the IDE, as chirpy does.
The second error that I constantly receive, though it doesn't seem to actually stop the generation of the .css files, is the following:
Error 53 Fatal error, cannot continue: null cannot be converted to an object C:\Users\Administrator\Projects\Project\Content\test.css 1 1 Project
I'd really love to use the LESS functionality that Chirpy offers, but until I can figure out why these errors are happening, I'm limited to using it for mash.
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(2)
你必须明白,Chirpy 只是在内部使用 dotlesscss 将 less 转换为 css。
因此,dotless 中的任何错误也适用于 Chirpy。
我们最近已经修复了该错误,新的 dotlesscss 版本即将推出。但是 Chirpy 更新到新版本需要多长时间取决于 Chirpy 开发人员。
问候 Daniel
you have to understand that Chirpy is simply using dotlesscss internally to transform the less into css.
So any bug in dotless also applies to Chirpy.
We have patched that bug quite recently and a new dotlesscss version is upcoming.. But how long it will take until Chirpy updates to the new version is up to the Chirpy developers..
greetings Daniel
我写了一个类似的 VS 扩展,它编译 less 但它直接使用 less.js 并且不依赖于 dotless。 查看一下。
I wrote a similar VS extension that compiles less but it uses less.js directly and doesn't depend on dotless. Check it out.