npm.io
9.0.1 • Published 5 months ago

rosid-handler-sass

Licence
MIT
Version
9.0.1
Deps
4
Size
7 kB
Vulns
0
Weekly
0
Stars
5

rosid-handler-sass

Test

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

Install

npm install rosid-handler-sass

Usage

API
const handler = require('rosid-handler-sass')

handler('main.sass').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-sass will transform all matching SASS files in your source folder to CSS.

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

Parameters

  • filePath {string} Absolute path to file.
  • options {?object} Options.
    • optimize {?boolean} - Optimize output. Defaults to false.

Returns

  • {Promise<string>} The transformed file content.

Keywords