trucks-transform-sass
v1.0.3
Published
Process style elements in web components with sass
Downloads
6
Readme
Sass Transform
Compile sass sources
Reads <style>
and <link>
elements with a MIME type of text/sass
and compiles the source to CSS using the bindings to libsass for node.
<link rel="stylesheet" type="text/sass" href="styles.scss">
<style type="text/sass"></style>
This transform rewrites the contents
property of each style node.
Install
npm i trucks-transform-sass --save-dev
For the command line interface see trucks-cli.
Usage
Use the sass
key to configure this transform:
const trucks = require('trucks');
trucks(
{
files: ['components.html'],
transforms: ['sass'],
conf: {
transforms: {
sass: {
includePaths: [process.cwd()]
}
}
}
}, (err, res) => {
if(err) {
throw err;
}
console.log(res);
}
);
The configuration object is passed to sass.render()
, see the sass documentation.
License
MIT
Created by mkdoc on July 18, 2016