1
0
mirror of https://github.com/thangisme/notes.git synced 2024-10-31 20:17:30 -04:00
notes/node_modules/postcss-scss
Patrick Marsceill b7b0d0d7bf
Initial commit
2017-03-09 13:16:08 -05:00
..
lib Initial commit 2017-03-09 13:16:08 -05:00
CHANGELOG.md Initial commit 2017-03-09 13:16:08 -05:00
LICENSE Initial commit 2017-03-09 13:16:08 -05:00
package.json Initial commit 2017-03-09 13:16:08 -05:00
README.md Initial commit 2017-03-09 13:16:08 -05:00

PostCSS SCSS Syntax Build Status

A SCSS parser for PostCSS.

This module does not compile SCSS. It simply parses mixins as custom at-rules & variables as properties, so that PostCSS plugins can then transform SCSS source code alongside CSS.

Sponsored by Evil Martians

Usage

SCSS Transformations

The main use case of this plugin is to apply PostCSS transformations directly to SCSS source code. For example, if you ship a theme written in SCSS and need Autoprefixer to add the appropriate vendor prefixes to it; or you need to lint SCSS with a plugin such as Stylelint.

var syntax = require('postcss-scss');
postcss(plugins).process(scss, { syntax: syntax }).then(function (result) {
    result.content // SCSS with transformations
});

Inline Comments for PostCSS

This module also enables parsing of single-line comments in CSS source code.

:root {
    // Main theme color
    --color: red;
}

Note that you dont need a special stringifier to handle the output; the default one will automatically convert single line comments into block comments.

var syntax = require('postcss-scss');
postcss(plugins).process(scss, { parser: syntax }).then(function (result) {
    result.css // CSS with normal comments
});

If you want Sass behaviour with removing inline comments, you can use postcss-strip-inline-comments plugin.