2

I want to use LessCSS for some of its benefits, but I don't want the user to have to download the less.js file or have it do any processing client side - I don't even want to have LessCSS working on my webserver. I'd like to write some Less, push it through LessCSS and then upload the resulting CSS file to the webserver.

Ideally I'd like LessCSS to process the Less file as when I save it in NetBeans and automagically pop out a css file.

Any ideas where to start?

1
  • There's a LESS PHP compiler available if you're using PHP and Sublime Text has compile functionality built into it's LESS plugin, however I have never seen anything for NetBeans. Commented Mar 13, 2012 at 16:41

2 Answers 2

3

Have a look at my blog entry (http://blog.nickdamoulakis.com/2012/04/php-less-css-and-cssjs-minify.html) where I list and describe a method I use.

Basically, I have a tab open in my browser that points to my compile.php. Whenever I want to 'compile' files, I just press F5 and it compiles JS-->MIN.JS, LESS-->CSS and CSS-->MIN.CSS. An INI file specifies which directories to process.

It is not a fully automated process but it works for what I need it to do. I hope it is of use to you.

Sign up to request clarification or add additional context in comments.

Comments

2

Check out SimpLESS. It's a standalone application, but it will monitor a folder for changes in .LESS files and auto compile them into CSS.

3 Comments

Yeah, this is exactly what I'm after. If it worked in Linux as it alleges it does it would be perfect. I do development on both windows and linux so I guess this is half the battle. I suppose I can use some sort of commandline thing for linux.
Ah, for Linux you can grab LESS from npm - node.js's package manager. It sounds like this includes a standard binary as well that you can compile .LESS files with. lesscss.org/#-server-side-usage
Just a heads up, it seems the compiler implementations differ a bit. I've been using dotlesscss.org on my server for dev work, but I tried SimpLESS for actually saving the CSS for production. Code that works fine with DotLESS actually compiles incorrectly with SimpLESS, so that's out as a solution for me. It may still be fine for you, but be sure to check the output.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.