dotless

How can I output errors when using .less programmatically?

て烟熏妆下的殇ゞ 提交于 2019-11-29 03:46:30
I've written an ASP.NET MVC action method that receives a .less file name, processes it via Less.Parse(<filename>) and outputs the processed css file. This works fine as long as the .less code is valid, but if there is an error, dotLess just returns an empty string. So if there is an error processing the file, my action method returns an empty css file. How can I output an error message with a closer description of the syntax error instead? The dotLess parser traps Exceptions and outputs them to a Logger. The snippet from dotLess's source that performs this is LessEngine.TransformToCss :

Visual studio - precompile - dotless

不想你离开。 提交于 2019-11-28 17:15:32
I wonder if there is a way to precompile *.less files( http://www.dotlesscss.org/ ) with visual studio. The site gives me a dotless.compiler.exe but I am not sure how to hook this up to visual studio. I am looking for a solution for both Webforms and ASP.NET MVC. David Longnecker Depending on your build environment, you can kick off dotless.Compiler.exe as a build task. For example, using a Pre-Build task in Visual Studio (all 1 line): $(SolutionDir)Tools\dotLess\dotless.compiler.exe -m $(ProjectDir)content\css\site.less $(ProjectDir)content\css\site.css The macros ( $(SolutionDir) , etc)

Dotless - Can't reference less variable in separate file with MVC Bundling

最后都变了- 提交于 2019-11-28 13:27:08
I hope I'm not creating a duplicate topic, but I've been searching for two days and can't find a solution to this. We are starting a new project in MVC4 and we have the less version of bootstrap loaded. The issue I'm running into is when I try to reference some classes or variables in the bootstrap.less , my global.less , or any thing outside the current file. I can create a variable in the top of the current file and use it just fine, but if I want to use something out of a separate file, I have to @import it. This would be fine if my entire app's less was in one file, but I'd have to @import

Open a file in Visual Studio's CSS Source Editor

家住魔仙堡 提交于 2019-11-28 05:24:50
I am using Phil Haack's T4CSS T4 template based on .less One bad thing about Phil's solution is that visual studio opens the .less files as plain text files rather than as css files. (Thus no intellisense.) How can I get VS to open a .less file in the CSS Source Editor? I've tried: Right Click > Open With, but the CSS Source Editor isn't listed. Tools > Options > Text Editor > File Extensions, but once again, CSS Source Editor isn't listed. Can this be done? I just posted an extension that does this; you can download it from the Visual Studio Gallery . The key to the extension is the .pkgdef

Visual studio - precompile - dotless

别来无恙 提交于 2019-11-27 10:20:26
问题 I wonder if there is a way to precompile *.less files(http://www.dotlesscss.org/) with visual studio. The site gives me a dotless.compiler.exe but I am not sure how to hook this up to visual studio. I am looking for a solution for both Webforms and ASP.NET MVC. 回答1: Depending on your build environment, you can kick off dotless.Compiler.exe as a build task. For example, using a Pre-Build task in Visual Studio (all 1 line): $(SolutionDir)Tools\dotLess\dotless.compiler.exe -m $(ProjectDir

Media Query grouping instead of multiple scattered media queries that match

邮差的信 提交于 2019-11-27 08:09:35
I'm experimenting with LESS (not a fan of the SASS syntax) and have been trying to find out what the best way to do media queries with it would be. I read through this blog post on how to "do" media queries with LESS, but it points out the fact that this causes all the media queries to be separated and scattered throughout the resulting CSS. This doesn't really bother me (I could care less about the result and more about it working). What did bother me was a comment that talked about issues when viewing from iOS devices and the commenter found that once the media queries were consolidated the

Dotless - Can't reference less variable in separate file with MVC Bundling

和自甴很熟 提交于 2019-11-27 07:41:38
问题 I hope I'm not creating a duplicate topic, but I've been searching for two days and can't find a solution to this. We are starting a new project in MVC4 and we have the less version of bootstrap loaded. The issue I'm running into is when I try to reference some classes or variables in the bootstrap.less , my global.less , or any thing outside the current file. I can create a variable in the top of the current file and use it just fine, but if I want to use something out of a separate file, I

Open a file in Visual Studio's CSS Source Editor

牧云@^-^@ 提交于 2019-11-27 05:33:35
问题 I am using Phil Haack's T4CSS T4 template based on .less One bad thing about Phil's solution is that visual studio opens the .less files as plain text files rather than as css files. (Thus no intellisense.) How can I get VS to open a .less file in the CSS Source Editor? I've tried: Right Click > Open With, but the CSS Source Editor isn't listed. Tools > Options > Text Editor > File Extensions, but once again, CSS Source Editor isn't listed. Can this be done? 回答1: I just posted an extension

Media Query grouping instead of multiple scattered media queries that match

走远了吗. 提交于 2019-11-26 14:02:52
问题 I'm experimenting with LESS (not a fan of the SASS syntax) and have been trying to find out what the best way to do media queries with it would be. I read through this blog post on how to "do" media queries with LESS, but it points out the fact that this causes all the media queries to be separated and scattered throughout the resulting CSS. This doesn't really bother me (I could care less about the result and more about it working). What did bother me was a comment that talked about issues