rosid-handler-sass

8.0.0 • Public • Published

rosid-handler-sass

Travis Build Status Coverage Status Dependencies Greenkeeper badge

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.
  • opts {?Object} Options.
    • optimize {?Boolean} - Optimize output. Defaults to false.

Returns

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

/rosid-handler-sass/

    Package Sidebar

    Install

    npm i rosid-handler-sass

    Weekly Downloads

    112

    Version

    8.0.0

    License

    MIT

    Unpacked Size

    8.17 kB

    Total Files

    7

    Last publish

    Collaborators

    • electerious