pos

postscss

node-sass + PostCss = PostScss

Showing:

Popularity

Downloads/wk

169

GitHub Stars

8

Maintenance

Last Commit

5yrs ago

Contributors

4

Package

Dependencies

5

Size (min+gzip)

78.5KB

License

ISC

Type Definitions

Tree-Shakeable

No?

Categories

Readme

PostScss NPM Downloads

node-sass + PostCss = PostScss.

PostScss compiles SASS into CSS then runs PostCSS plugins. It also supports importing Eyeglass modules.

Install

npm i postscss

Usage

var postscss = require('postscss');

// Single build
postscss([postcss plugins]).process({
    from: 'xxx/src/scss/xxx.scss',
    to: 'xxx/dist/css/xxx.css'
});

// Disabling source maps
postscss([postcss plugins]).process({
    from: 'xxx/src/scss/xxx.scss',
    to: 'xxx/dist/css/xxx.css',
    sourceMapDisabled: true
});

// Multiple builds
postscss([postcss plugins]).processMany([{
    from: 'xxx/src/scss/xxx.scss',
    to: 'xxx/dist/css/xxx.css'
}, {
    from: 'xxx/src/scss/xxx2.scss',
    to: 'xxx/dist/css/xxx2.css'
}]);

Promises

var postscss = require('postscss');

postscss([postcss plugins]).process({
    from: 'xxx/src/scss/xxx.scss',
    to: 'xxx/dist/css/xxx.css'
})
.then(function() {
    console.log('All done.');
})
.catch(function(error) {
    // Error handling.
});

PostCss plugins example

var postscss = require('postscss');
var autoprefixer = require('autoprefixer');
var cssnano = require('cssnano');

postscss([autoprefixer(['> 5%', 'last 2 versions', 'ie > 7']), cssnano()]).process({
    from: 'xxx/src/scss/xxx.scss',
    to: 'xxx/dist/css/xxx.css'
});

Grunt example

grunt.registerTask('compileSCSS', 'Task description.', function () {
    var done = this.async();

    var postscss = require('postscss');

    postscss([postcss plugins]).process({
        from: 'xxx/src/scss/xxx.scss',
        to: 'xxx/dist/css/xxx.css'
    })
    .then(done);
});

SASS importer

var postscss = require('postscss');
var npmsass = require('npm-sass');

postscss([postcss plugins]).process({
    from: 'xxx/src/scss/xxx.scss',
    to: 'xxx/dist/css/xxx.css',
    importer: npmsass.importer
});

Rate & Review

Great Documentation0
Easy to Use0
Performant0
Highly Customizable0
Bleeding Edge0
Responsive Maintainers0
Poor Documentation0
Hard to Use0
Slow0
Buggy0
Abandoned0
Unwelcoming Community0
100
No reviews found
Be the first to rate

Alternatives

No alternatives found

Tutorials

No tutorials found
Add a tutorial