0.0.8 • Published 7 years ago

postass v0.0.8

Weekly downloads
1
License
MIT
Repository
github
Last release
7 years ago

postass

Build Status

Postass compiles sass/scss to css via node-sass and then converts it using PostCSS plugin.

Table of Contents

Feature

  • Compiling Sass
  • Watching directory or file
  • Using PostCSS plugin (Currently only plug-ins described directly in the code)

Install

Install with npm:

npm install postass

Usage

var postass = require('postass');
postass.render({
    file: src
    [, options]
}, function(err, result) {
});

Options

autoprefixer

Type:Boolean Default:false

Whether to use Autoprefixer

autoprefixerBrowsers

Type:String Default:'1%, last 2 versions, Firefox ESR'

BrowserList used by Autoprefixer. Separate by commas

autoprefixerRemoveOutdated

Type:Boolean Default:false

Remove flag used by Autoprefixer

compress

Type:Boolean Default:false

Whether to compress

imageBasePath

Type:String Default:''

Image base path

/* Input example */
.foo {
    background-image: url(images/test.png);
}
/* Output example */
.foo {
    background-image: url(http://static.example.com/images/test.png);
}

imageUrlEncode

Type:Boolean Default:false

Whether to encode image url

/* Input example */
.foo {
    background-image: url(http://static.example.com/images/test.png);
}
/* Output example */
.foo {
    background-image: url(http%3A%2F%2Fstatic.example.com%2Fimages%2Ftest.png);
}

imageUrlPrefix

Type:String Default:''

Prefix to image url

/* Input example */
.foo {
    background-image: url(http://static.example.com/images/test.png);
}
/* Output example */
.foo {
    background-image: url(http://example.com?url=http%3A%2F%2Fstatic.example.com%2Fimages%2Ftest.png);
}

file

Type:String Default:''

Input file

outFile

Type:String Default:''

Output file

rev

Type:String Default:''

Revision number

Command Line Interface

postass [options] <input.scss>

When compiling input.scss to output.css

postass input.scss output.css --autoprefixer --image-base-path http://static.example.com/

When monitoring the change of the scss folder and compiling to the css folder upon change

postass ./scss/ --output ./css/ --watch --autoprefixer --image-base-path http://static.example.com/

When using the config file

postass --config postass.json

This option allows you to specify an additional configuration file (see Usage options for more).

Options

--autoprefixer                  Whether to use Autoprefixer
--autoprefixer-browsers         BrowserList used by Autoprefixer
--autoprefixer-remove-outdated  Remove flag used by Autoprefixer
--compress                      Whether to compress
--config                        Path to config file
--image-base-path               Image base path
--image-url-encode              Whether to encode image url
--image-url-prefix              Prefix to image url
--output                        Output directory
--rev                           Revision number
--watch                         Whether to monitor directory or files
--version                       Print version
--help                          Print usage

Contribute

PRs accepted.

Small note: If editing the README, please conform to the standard-readme specification.

License

MIT © gloops, Inc.