Visual Studio 2010 中的 DotLess IntelliSense
我最近发现了 DotLess 库,我对此感到非常兴奋,因为 CSS 一直让我烦恼。我认为这个库使用起来会非常方便。不幸的是,一旦我尝试了一下,我发现VS 2010不为带有.less扩展名的文件提供IntelliSense。这实际上让我感到沮丧,我决定不再使用 DotLess,直到有一天 VS 2010 提供 IntelliSense。
Jon Galloway 的视频 MVC 开发人员应该了解 HTML 和 CSS 讨论了 HTML/CSS 和一些方便的内容包括 DotLess 在内的提示,他提到了 Phil Haack 的 T4 模板,该模板允许我使用 .less.css 扩展名,然后它会执行一些操作来生成正确的 CSS 文件。
我访问 Phil 的博客并找到了 帖子他谈到了 T4 模板。没有指向 T4 模板的直接链接,并且他的博客文章中的链接已失效,该文章相对过时(2009 年)。
有人对这个问题有任何解决方案吗?我真的很想使用 DotLess 库,但我不想失去 IntelliSense。
I've recently found out about the DotLess library and I was so excited about it because CSS has been always annoying for me. I thought this library would be very convenient to use. Unfortunately, once I tried it out, I found out that VS 2010 does not provide IntelliSense for files with the .less extension. That actually got me frustrated and I decided not to use DotLess until VS 2010 provides IntelliSense someday.
Jon Galloway's video What MVC Developers Should Know About HTML and CSS talks about HTML/CSS and some handy tips including DotLess, and he mentioned something about a T4 template by Phil Haack that would allow me to use .less.css extension and then it does something to generate the proper CSS file.
I went to Phil's blog and located the post in which he talks about that T4 template. There are no direct links to the T4 template and the links are dead in his blog post which is relatively outdated (2009).
Does anyone have ANY solution to this issue? I really want to use the DotLess library, but I do not want to lose the IntelliSense.
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(4)
出于某种原因,我在发布这个问题后立即找到了解决方案。 是来自 StackOverflow 的两个线程,讨论了这个问题并提供了实际有效的解决方案:
以下 -editor">在 Visual Studio 的 CSS 源编辑器中打开文件
如何在 .less 文件上打开 Visual Studio 2010 .css Intellisense
PS:我使用了 Noah Richards 提出的解决方案,效果非常好。
好吧,我对此感到抱歉,我从这个帖子中学到的教训是在下次发帖之前更好地寻找答案。
For some reason, I found out the solution right after I posted this question. Here are two threads from StackOverflow that talk about this issue and provide solutions that actually work:
Open a file in Visual Studio's CSS Source Editor
How to turn on Visual Studio 2010 .css Intellisense on .less file
P.S: I used the solution proposed by Noah Richards and it works perfectly.
Well, I'm sorry about that, the lesson I learned from this thread is to look much better for answers before posting next time.
博客中的链接应指向 http://www.dotlesscss.org/
查看 t4css*。 https://github.com/dotless/dotless/downloads 中包含 .tt 的 zip 文件文件(T4 模板)
如果您想知道 T4 模板是什么,请查看 这个。
The link in the blog should point at http://www.dotlesscss.org/
Check out the t4css*.zip files at https://github.com/dotless/dotless/downloads which contain the .tt file (T4 template)
If you're wondering what a T4 template is, have a look at this.
我使用 http://www.mindscapehq.com/products/web-workbench 来获取视觉工作室中“更少”的智能感知。
I use http://www.mindscapehq.com/products/web-workbench to get 'less' intellisense in visual studio.
http://maghansson.blogspot.com/2011/12/aspless -and-sharepoint-2010.html
以下说明如何下载 dotless 软件包并获得智能感知和其他功能的所有优势
http://maghansson.blogspot.com/2011/12/aspless-and-sharepoint-2010.html
Here's instructions how to download the package for dotless and get all the benefits of intellisense and other functions