postcss-less
DefinitelyTyped icon, indicating that this package has TypeScript declarations provided by the separate @types/postcss-less package

0.2.0 • Public • Published

PostCSS LESS syntax

Build Status npm npm

A LESS parser for PostCSS.

This module does not compile LESS. It simply parses mixins as custom at-rules & variables as properties, so that PostCSS plugins can then transform LESS source code alongside CSS.

Use cases

  • lint your LESS code with a plugin such as Stylelint.
  • apply PostCSS transformations (such as Autoprefixer) directly to the LESS source code

Usage

const syntax = require('postcss-less');
postcss(plugins).process(yourLessCode, {syntax: syntax}).then((result) => {
    // result.content - LESS with transformations
});

Restrictions

Skipped blocks:

  • nested mixins with custom token nested-mixin
  • nested &:extend(); with custom token nested-extend

Appreciation

Current module is based on great postcss-scss library and inspired by another LESS parser for PostCSS - postcss-less

Package Sidebar

Install

npm i postcss-less@0.2.0

Version

0.2.0

License

MIT

Last publish

Collaborators

  • shellscape