Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
Convert LESS into CSS outside of VS 2012
Message
General information
Forum:
CSS
Category:
Other
Miscellaneous
Thread ID:
01591375
Message ID:
01591974
Views:
28
Thank you!

>In VS 2012, make sure Web Essentials is installed. Navigate to your LESS file in (with .less extension) in Solution Explorer. Right click, Web Essentials - there should be an option to auto-compile LESS file on save or something to that effect.
>
>In VS 2013 LESS support is built into Visual Studio, so when you create a LESS file it automatically creates the compiled .css and .min.css file on save. With Web Essentials in 2012 you have to tell Web Essentials to manage the file if I recall right.
>
>+++ Rick ---
>
>>I did read your message. But what I don't understand is how Web Essentials on VS 2012 or VS 2013 works with .LESS files. If it compiles .LESS file on-the-fly (pretty much as Dotless claims to do) I thought I may have the same problem with Web Essentials as I have with Dotless when using Form Authentication. This is why I decided, for now, remove Dotless from the project, compile .less into .css every time I make changes to .less file, and linking the .css into the Site.master.
>>
>>>Not sure if you read my message, but Web Essentials on VS 2012 should support LESS the same ways as in VS 2013. If that's the case you shouldn't need DotLess.
>>>
>>>I can't double check this here since I don't have VS 2012 installed any more, but it used to work there and the docs indicate LESS editor support and talks about LESS compilation. It's in there I'm pretty sure.
>>>
>>>+++ Rick ---
>>>
>>>>Your messages prompted me to look into the problem I have been having since installing DotLess. The problem was that when using Form Authentication the login form would never "recognize" the .less file. That is, the Login page didn't use any styles defined in the My.less file. (Note that .less would work if I make the application work in anonymous mode). So what I just did is compiled the .less file into a .css file outside of VS 2012. And then linked the my.min.css into the Site.master, instead of the my.less file. And now I see that the log in page uses all the correct styles. I don't know if this is a bug with Dotless or I need to define in my web.config to allow Dotless work before the application is authenticated (and I don't know how to do it). But at least, until I upgrade to VS 2013 with Web Essentials, I have a work around or using .less.
>>>>Thank you very much for your message.
>>>>
>>>>>Web Essentials works on VS 2012 and has LESS support (unless it was removed recently as Mads has removed features for the 2013 version as they are integrated in VS now). This is the best option by far IMHO.
>>>>>
>>>>>Doing on the fly LESS with something like DotLess works, but DotLess is kind of buggy and it adds a bit of overhead to your server as LESS files are processed and cached in ASP.NET instead of in core IIS.
>>>>>
>>>>>Prior to Web Essentials there also used to be a few third party libraries that provided LESS support for Visual Studio - you can look for those as well. Failing that there are also lots of command line tools that will do this - the entire JavaScript build eco-system is there. Grunt and support librarires allow doing this as well and it's fairly easy to hook this in with
>>>>>
>>>>>There's also a bunch of useful info here:
>>>>>http://stackoverflow.com/questions/2986204/less-css-on-windows
>>>>>
>>>>>+++ Rick ---
>>>>>
>>>>>>I have VS 2012 installed on this laptop and only have about 9GB of free space on the C: drive. So I am limited to what I can add to this laptop (like VS 2013 with Web Essentials which would be nice). While I do development on VS 2012 the DOTLESS converts the LESS file to CSS, dynamically. Now I am starting to test this project on a DiscountAsp.net site (I purchased just for testing). Since I don't know how to make the public site "understand" the LESS type file, I would like to convert the LESS file into the .CSS and then copy the .CSS to the public site.
>>>>>>
>>>>>>What stand-alone tool you recommend to convert LESS to CSS?
"The creative process is nothing but a series of crises." Isaac Bashevis Singer
"My experience is that as soon as people are old enough to know better, they don't know anything at all." Oscar Wilde
"If a nation values anything more than freedom, it will lose its freedom; and the irony of it is that if it is comfort or money that it values more, it will lose that too." W.Somerset Maugham
Previous
Reply
Map
View

Click here to load this message in the networking platform