It's CSS, with just a little more
open sourceApache-2.0self-hostablefree
Less (Leaner Style Sheets) is a backwards-compatible language extension for CSS, and Less.js is the JavaScript tool that compiles it to CSS. It adds variables, mixins (including guarded and parametric ones), nesting with bubbling at-rules, operations, built-in colour, maths and string functions, namespaces, maps, scope and imports, while any valid CSS stays valid Less. You compile with the lessc command, from Node.js, in build tools, or in the browser with less.js for development. Less was created in 2009 by Alexis Sellier, inspired by Sass with a syntax closer to CSS, and is maintained by a core team of volunteers under Apache-2.0.
Problems it solves
- repeat the same colours and sizes across a big stylesheet without copying hex values everywhere
- reuse a block of CSS declarations in many rules with parameters, like a function
- nest selectors and media queries inside their parent rule so the stylesheet mirrors the HTML
- darken, lighten or mix brand colours with functions instead of picking every shade by hand
- split our CSS into files and import them into one compiled stylesheet
- maintain an older theme or framework whose styles are written in Less
- try out stylesheet variables in the browser during development without a build step
- compile stylesheets from the command line in a build script
Features
- variables, including lazy evaluation and variable interpolation
- mixins with parameters, guards and pattern matching
- nesting with nested at-rules that bubble up
- operations on numbers, colours and units
- built-in functions for colours, maths, strings, lists and types
- namespaces and accessors, maps and scope
- @import with options (reference, inline, optional and more)
- lessc command-line compiler with options
- compiles in Node.js or in the browser with less.js
- plugins that add functions, preprocessors and file managers
View 1 more
- any valid CSS is valid Less
Capabilities
| Has a command line tool | plan not known |
|---|---|
| Takes plugins | plan not known |
Alternatives
The same job
These do what Less does.