https://github.com/electerious/rosid-handler-sass
Load SCSS and transform to CSS, add vendor prefixes and minify.
https://github.com/electerious/rosid-handler-sass
minify rosid sass scss transpiler
Last synced: about 1 year ago
JSON representation
Load SCSS and transform to CSS, add vendor prefixes and minify.
- Host: GitHub
- URL: https://github.com/electerious/rosid-handler-sass
- Owner: electerious
- License: mit
- Created: 2015-12-27T21:06:51.000Z (over 10 years ago)
- Default Branch: master
- Last Pushed: 2022-01-08T15:52:43.000Z (over 4 years ago)
- Last Synced: 2025-04-30T07:54:31.356Z (about 1 year ago)
- Topics: minify, rosid, sass, scss, transpiler
- Language: JavaScript
- Homepage:
- Size: 91.8 KB
- Stars: 6
- Watchers: 2
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- Changelog: CHANGELOG.md
- License: LICENSE
Awesome Lists containing this project
README
# rosid-handler-sass
[](https://travis-ci.org/electerious/rosid-handler-sass) [](https://coveralls.io/github/electerious/rosid-handler-sass?branch=master) [](https://david-dm.org/electerious/rosid-handler-sass#info=dependencies) [](https://greenkeeper.io/)
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
```js
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](https://github.com/electerious/Rosid/blob/master/docs/Routes.md). `rosid-handler-sass` will transform all matching SASS files in your source folder to CSS.
```json
{
"name" : "SASS",
"path" : "[^_]*.{css,sass}*",
"handler" : "rosid-handler-sass"
}
```
```sass
/* main.sass */
.class
color: white;
```
```css
/* 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}` The transformed file content.