0.2.0 • Published 4 years ago

metalsmith-uncss-2 v0.2.0

Weekly downloads
2
License
GPL-3.0-or-later
Repository
github
Last release
4 years ago

metalsmith-uncss-2

npm Version node Version npm Weekly Downloads

Known Vulnerabilities Test Coverage Maintainability

GitHub License

A Metalsmith plugin to run UnCSS stylesheet optimizer.

Installation

npm install --save metalsmith-uncss-2

JavaScript Usage

const Metalsmith = require('metalsmith');
const uncss      = require('metalsmith-uncss-2');

Metalsmith(__dirname)
    .use(uncss({
        // options here
    }))
    .build((err) => {
        if (err) {
            throw err;
        }
    });

Options

html (optional)

Type: string Default: **/*.html

A minimatch glob pattern to find HTML files.

css (optional)

Type: string Default: **/*.css

A minimatch glob pattern to find CSS files.

output (optional)

Type: string Default: uncss.css

The output CSS filename.

uncss (optional)

Type: object Default:

{
  "banner": false,
  "jsdom": {
    "runScripts": "outside-only"
  }
}

An object of UnCSS options.

Example

const uncss = require('metalsmith-uncss-2');

Metalsmith(__dirname)
    .use(uncss({
        output: 'static/css/styles.css',
        uncss: {
            ignore: [
                // Bootstrap 4 JavaScript
                /\.carousel-item-.+/,
                /\.modal/,
                /\.show/
            ]
        }
    }))

Changelog

Changelog

0.2.0

4 years ago

0.1.5

4 years ago

0.1.4

5 years ago

0.1.3

5 years ago

0.1.2

5 years ago

0.1.1

5 years ago

0.1.0

5 years ago

0.0.4

5 years ago

0.0.3

5 years ago

0.0.2

5 years ago

0.0.1

5 years ago