Skip to content

Load LESS and transform to CSS, add vendor prefixes and minify

License

Notifications You must be signed in to change notification settings

freedeebee/rosid-handler-less

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

3 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

rosid-handler-less

Travis Build Status Coverage Status Dependencies

A function that loads a LESS file, transforms it to CSS, adds vendor prefixes and minifies the output.

Install

npm install rosid-handler-less

Usage

API

const handler = require('rosid-handler-less')

handler('main.less').then((data) => {})
handler('main.css', { optimize: true }).then((data) => {})

Rosid

Add the following object to your rosidfile.json, rosidfile.js or routes array. rosid-handler-less will transform all matching LESS files in your source folder to CSS.

{
  "name"    : "LESS",
  "path"    : "[^_]*.{css,less}*",
  "handler" : "rosid-handler-less"
}
/* main.less */
.class {
  color: white;
}
/* main.css (output) */
.class { color: white; }

Parameters

  • filePath {String} Absolute path to file.
  • opts {?Object} Options.
    • optimize {?Boolean} - Optimize output. Defaults to false.

Returns

  • {Promise<String|Buffer>} The transformed file content.

About

Load LESS and transform to CSS, add vendor prefixes and minify

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published