Maecenas eu bibendum lacus. Cras dapibus neque at mauris commodo aliquet. Nullam ipsum dolor, vehicula viverra ultrices nec, posuere sed magna. Sed sit amet metus eget ipsum tincidunt porttitor ac at orci. Proin ut quam non nibh tempor mollis sit amet nec dui. Cras pellentesque metus id viverra pellentesque. Aenean libero ante, varius non viverra ac, auctor eu urna. Nunc vitae ultricies erat. Etiam gravida venenatis ipsum eu suscipit. Sed ornare hendrerit sapien et venenatis.

Praesent eu varius ante. Sed laoreet mattis velit, eget posuere mauris euismod eget. Sed bibendum neque a nisl euismod laoreet. Suspendisse a magna a tortor venenatis dignissim vel vel elit. Proin vitae placerat arcu, a elementum erat. Aliquam rhoncus elementum enim quis eleifend. Sed lacinia mi risus. Praesent eget diam eu neque viverra pharetra. Aenean vestibulum facilisis arcu non tempor. Nam vitae neque semper, semper erat eget, pulvinar purus. Nullam eget augue quis lectus laoreet aliquet. Praesent eget est odio. Nulla in tortor vel nulla eleifend fringilla. Aliquam erat volutpat.

Variables

Less allows variables to be defined. Less variables are defined with an at sign(@). Variable assignment is done with a colon (:).

During translation, the values of the variables are inserted into the output CSS document.

Mixins

Ut eu justo ante. Etiam eget diam sed orci semper elementum. Nulla eget imperdiet felis, ut sagittis mi. Ut placerat sit amet eros ac iaculis. Cum sociis natoque penatibus et magnis dis parturient montes, nascetur ridiculus mus. Suspendisse potenti. Etiam laoreet nulla in quam dapibus, non luctus arcu commodo. Vestibulum imperdiet lobortis tortor et consequat.

Nesting

Ut eu justo ante. Etiam eget diam sed orci semper elementum. Nulla eget imperdiet felis, ut sagittis mi. Ut placerat sit amet eros ac iaculis. Cum sociis natoque penatibus et magnis dis parturient montes, nascetur ridiculus mus. Suspendisse potenti. Etiam laoreet nulla in quam dapibus, non luctus arcu commodo. Vestibulum imperdiet lobortis tortor et consequat. Aliquam magna diam, dapibus eget pellentesque sed, vehicula nec metus. Pellentesque at imperdiet augue, quis lobortis ante. Nunc accumsan non ipsum id eleifend. Nam suscipit urna eu viverra semper. Aliquam hendrerit sollicitudin erat, in mattis ligula mollis at. Cras pellentesque dui sit amet elit tempus fringilla id eu erat.

Functions and operations

Less allows operations and functions. Operations allows addition, subtraction, division and multiplication of property values and colors, which can be used to create complex relationships between properties. Functions map one-to-one with JavaScript code, allowing manipulation of values.

Comparison to Sass

LESS is inspired by Sass. Sass was designed to both simplify and extend CSS, so things like curly braces were removed from the syntax. LESS was designed to be as close to CSS as possible, so the syntax is identical to existing CSS code. As a result, existing CSS can be used as valid LESS code.

The newer versions of Sass also introduced a CSS-like syntax called SCSS (Sassy CSS).

Use on sites

LESS can be applied to sites in a number of ways. One option is to include the less.js JavaScript file to convert the code on-the-fly. The browser then renders the output CSS. Another option is to render the LESS code into pure CSS and upload the CSS to a site. With this option no .less files are uploaded and the site does not need the less.js JavaScript converter.

From Wikipedia, the free encyclopedia