Designed by | Alexis Sellier |
---|---|
Developer | Alexis Sellier, Dmitry Fadeyev |
First appeared | 2009 |
Stable release |
2.7.1 / May 9, 2016
|
Typing discipline | dynamic |
Implementation language | JavaScript |
OS | Cross-platform |
License | Apache License 2 |
Filename extensions | .less |
Website | lesscss |
Influenced by | |
CSS, Sass | |
Influenced | |
Sass, Less Framework, Bootstrap |
Less (sometimes stylized as LESS) is a dynamic style sheet language that can be compiled into Cascading Style Sheets (CSS) and run on the client side or server side. Designed by Alexis Sellier, Less is influenced by Sass and has influenced the newer "SCSS" syntax of Sass, which adapted its CSS-like block formatting syntax. Less is open source. Its first version was written in Ruby; however, in the later versions, use of Ruby has been deprecated and replaced by JavaScript. The indented syntax of Less is a nested metalanguage, as valid CSS is valid Less code with the same semantics. Less provides the following mechanisms: variables, nesting, mixins, operators and functions; the main difference between Less and other CSS precompilers being that Less allows real-time compilation via less.js by the browser.
Less allows variables to be defined. Variables in Less 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.
The code above in Less would compile to the following CSS code.
Mixins allow embedding all the properties of a class into another class by including the class name as one of its properties, thus behaving as a sort of constant or variable. They can also behave like functions, and take arguments. CSS does not support Mixins. Any repeated code must be repeated in each location. Mixins allow for more efficient and clean code repetitions, as well as easier alteration of code.