# less

> Leaner CSS

Latest version **4.9.1** (published 2026-09-02) · Apache-2.0 license · 0 weekly downloads

## Install

```sh
npm install less
pnpm add less
yarn add less
bun add less
```

Provides the command `lessc`.

## Health

**Score 78/100 (B)** — status: active.

Positive: has types package; esm support; no vulnerabilities; has provenance; recently updated; high maintenance score; high quality score; popular repo.

Warnings: low downloads.

## Facts

| | |
|---|---|
| Version | 4.9.1 |
| Published | 2026-09-02 |
| First published | 2011-01-23 |
| Weekly downloads | 0 |
| License | Apache-2.0 |
| TypeScript types | separate (@types/less) |
| Module format | ESM + CommonJS |
| Node | >=18 |
| Dependencies | 2 |
| Unpacked size | 3.1 MB |
| Known vulnerabilities | 0 |
| Install scripts | no |
| Provenance | attested (GitHub Actions) |
| GitHub stars | 17025 |
| Author | Alexis Sellier |
| Maintainers | matthew-dean, cloudhead, meri, seven-phases-max, lukeapage |
| Keywords | compile less, css nesting, css variable, css, gradients css, gradients css3, less compiler, less css, less mixins, less, less.js, lesscss, mixins, nested css, parser, preprocessor, bootstrap css, bootstrap less, style, styles, stylesheet, variables in css, css less |

## Links

- npm: https://www.npmjs.com/package/less
- Repository: https://github.com/less/less.js
- Homepage: http://lesscss.org
- Issues: https://github.com/less/less.js/issues
- npm.io page: https://npm.io/package/less

## Dependencies (2)

- [copy-anything](https://npm.io/package/copy-anything.md) ^3.0.5
- [parse-node-version](https://npm.io/package/parse-node-version.md) ^1.0.1

## Alternatives

- [style-dictionary](https://npm.io/package/style-dictionary.md) — 2.0M weekly downloads
- [postcss-merge-idents](https://npm.io/package/postcss-merge-idents.md) — 1.7M weekly downloads
- [@fontsource/noto-sans](https://npm.io/package/@fontsource/noto-sans.md) — 93.0K weekly downloads
- [uglifycss](https://npm.io/package/uglifycss.md) — 71.6K weekly downloads
- [mat4-interpolate](https://npm.io/package/mat4-interpolate.md) — 23.3K weekly downloads

## Recent versions

- 4.9.1 (latest) — 2026-09-02
- 5.0.0-alpha.5 (alpha) — 2026-09-12
- 4.6.3-beta.0 (beta) — 2026-03-11
- 3.13.1-next.1 (canary) — 2020-12-17
- 5.0.0-alpha.4 — 2026-09-05
- 5.0.0-alpha.3 — 2026-09-03
- 5.0.0-alpha.2 — 2026-09-02
- 5.0.0-alpha.1 — 2026-08-13
- 4.9.0 — 2026-08-13
- 4.8.1 — 2026-07-27
- 4.8.0 — 2026-07-22
- 4.7.0 — 2026-07-18
- 4.6.7 — 2026-06-22
- 4.6.6 — 2026-06-14
- 4.6.5 — 2026-06-13
- … 141 more at https://npm.io/package/less/versions

## README

<p align="center"><img src="http://lesscss.org/public/img/less_logo.png" width="264" height="117" alt="Less.js logo"></p>

<p align="center">
    <a href="https://github.com/less/less.js/actions?query=branch%3Amaster"><img src="https://github.com/less/less.js/actions/workflows/ci.yml/badge.svg?branch=master" alt="Github Actions CI"/></a>
    <a href="https://www.npmtrends.com/less"><img src="https://img.shields.io/npm/dm/less.svg?sanitize=true" alt="Downloads"></a>
    <a href="https://www.npmjs.com/package/less"><img src="https://img.shields.io/npm/v/less.svg?sanitize=true" alt="npm version" /></a>
</p>

# Less.js

> The dynamic stylesheet language. [lesscss.org](http://lesscss.org)

Less extends CSS with variables, mixins, functions, nesting, and more — then compiles to standard CSS. Write cleaner stylesheets with less code.

```less
@primary: #4a90d9;

.button {
  color: @primary;
  &:hover {
    color: darken(@primary, 10%);
  }
}
```

## Install

```sh
npm install less
```

## Usage

### Node.js

```js
import less from 'less';

const output = await less.render('.class { width: (1 + 1) }');
console.log(output.css);
```

### Command Line

```sh
npx lessc styles.less styles.css
```

### Browser

```html
<link rel="stylesheet/less" type="text/css" href="styles.less" />
<script src="https://cdn.jsdelivr.net/npm/less"></script>
```

## Why Less?

- **Variables** — define reusable values once
- **Mixins** — reuse groups of declarations across rulesets
- **Nesting** — mirror HTML structure in your stylesheets
- **Functions** — transform colors, manipulate strings, do math
- **Imports** — split stylesheets into manageable pieces
- **Extend** — reduce output size by combining selectors

## Documentation

Full documentation, usage guides, and configuration options at **[lesscss.org](http://lesscss.org)**.

## Contributing

Less.js is open source. [Report bugs](https://github.com/less/less.js/issues), submit pull requests, or help improve the [documentation](https://github.com/less/less-docs).

See [CONTRIBUTING.md](https://github.com/less/less.js/blob/master/CONTRIBUTING.md) for development setup.

## License

Copyright (c) 2009-2025 [Alexis Sellier](http://cloudhead.io) & The Core Less Team
Licensed under the [Apache License](https://github.com/less/less.js/blob/master/LICENSE).

---
_Source: https://npm.io/package/less · Machine-readable twin of the npm.io package page. Health data is recomputed on every publish._
