metalsmith-sense-sass

2.1.0 • Public • Published

metalsmith-sense-sass

A sensible distribution of Sass for Metalsmith.

  • uses metalsmith-sass with environment-specific defaults
    • compresses output on production
    • adds source maps in development mode
  • uses metalsmith-postcss for optional postcss plugins to be used after Sass
  • uses postcss-cssnext when available (for vendor prefix polyfills and more)
  • ignores sass partials (_*.sass)

Status

Options

require('metalsmith-sense-sass')(options)

Available options:

  • sass (Object) — Options to pass to metalsmith-sass. See node-sass for a list of available options.

  • postcss (Object) — List of plugins to load for postcss. This is in the format of a key/value object, where keys are string package names, and the values are options to be passed to each plugin.

Environment variables:

  • NODE_ENV (environment variable) — set to production to enable compression and disable source maps.

Usage

npm install --save metalsmith-sense-sass
  • When using metalsmith.json:

    {
      "plugins": {
        "metalsmith-sense-sass": {}
      }
    }
  • When using metalsmith.js:

    var ms = new Metalsmith(__dirname)
      .source('src')
      .destination('public')
      .use(require('metalsmith-sense-sass')())

For other installation options (eg, using other postcss plugins), see Installation.

Upgrading from 1.x

metalsmith-sense-sass 1.x uses autoprefixer by default, which 2.x doesn't anymore. To upgrade and keep the old behavior, simply install postcss-cssnext in your project—cssnext includes autoprefixer, and metalsmith-sense-sass will automatically use cssnext if it's available.

Also see

Also consider metalsmith-start as a convenient development server with LiveReload support and more.

Thanks

metalsmith-sense-sass © 2015+, Rico Sta. Cruz. Released under the MIT License.
Authored and maintained by Rico Sta. Cruz with help from contributors (list).

ricostacruz.com  ·  GitHub @rstacruz  ·  Twitter @rstacruz

Package Sidebar

Install

npm i metalsmith-sense-sass

Weekly Downloads

0

Version

2.1.0

License

MIT

Last publish

Collaborators

  • rstacruz