Richard
Richard

Reputation: 65550

Can I use Less in my own text editor without compiling?

I would like to start using Less rather than writing CSS from scratch, but is it possible to use Less in such a way that all the following things are true:

I've tried to Google the answer to these questions, but I can't figure out a clear answer. Thanks for your help.

Upvotes: 0

Views: 1103

Answers (2)

Frank Lämmer
Frank Lämmer

Reputation: 2325

The short practical answer

There are several tools out there that help you to compile your LESS into CSS on the fly each time you save your LESS file. Most tools do much more than just compiling LESS, they also come with "live reload" functionality, compile coffeescript, handlebars, SCSS, run JSlint, combine JS, etc.

LESS compile tools selection:

Please consider project size. most of the tools work really great if you work alone, but for team work you'll need some sort of configuration standard (config file).

Upvotes: 1

GaryP
GaryP

Reputation: 2173

When using LESS CSS, you still have to write your css styles from scratch. Not unless you have and use your own css framework. If you use or have as such, you may just have to define your VARIABLE and MIXINS,and your additional custom styles.

Such LESS CSS Framework includes Twitter Bootstrap. You don't have write CSS from scratch when you use it in your font-end development, you only need to add/adjust your own customizations.

You can write LESS with your editor (TextMate).
Since LESS file is also a CSS file with an extension of LESS (style.less). Only that your browser cannot parse the LESS file without using LESS in client side (by linking to less.js file in your document head). If you checkout this page, you can see that TexTMate is listed as one of the Editors that supports LESS (It has syntax highlighting).

You don't have to compile LESS to CSS file manually.

When compiling LESS file to CSS file, you have the Command Line compilers and the GUI compilers. When using Command Line compiler, you'll have to use of course your terminal to command the compiling ($ lessc style.less style.css). When you opt to use the Command line option, you'll have to install NPM and Node.js. Install NPM first, before Installing Node.js, since NPM will let you install Node.

You will not rely on JavaScript in production, if using LESS, because you only use LESS during development. You will be using JavaScript (less.js) when you opt to use LESS in Client Side (browser side).

Here are some links that will give more info about LESS Usage http://lesscss.org/#synopsis:

LESS CSS is a CSS Pr-processor just like Sass

Some LESS Examples
Using Variables: Using variables during development, makes your work flow faster. Changing colors is just a breeze using variables.

 @black:                 #000;
 @grayDarker:            #222;

 body {
   color: @grayDarker;
   background: @black;
 }


Read more examples from the given links.

Upvotes: 0

Related Questions