CSS Less: Extend CSS By Adding Variables, Mixins, Operations and Nested Rules

LESS is an extension to CSS. Less uses existing css syntax. This means you can migrate your current .css files to .less in seconds and there is virtually no learning curve.

The best way to explain Less is to show you some code, so please go ahead and check out the examples below.

Variables

Variables allow you to specify widely used values in a single place, and then re-use them throughout the style sheet, making global changes as easy as changing one line of code.

Regular CSS

#header {

color: #4D926F;

}

h2 {

color: #4D926F;

}

LESS CSS

@brand_color: #4D926F;
#header {

color: @brand_color;

}
h2 {

color: @brand_color;

}

Spread this KnowTe

Digg Del.icio.us Stumble Float Technorati Bump
Leave a comment!
Note: You can also use your free Gravatar avatar on Knowtebook! Please also read our Publishing Policy before posting.

Ja, ich möchte bei Kommentaren benachrichtigt werden!