This package has been deprecated

Author message:

WARNING: This project has been renamed to metalsmith-css-unused. Install using metalsmith-css-unused instead.

metalsmith-uncss-2

0.2.0 • Public • Published

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

Package Sidebar

Install

npm i metalsmith-uncss-2

Weekly Downloads

1

Version

0.2.0

License

GPL-3.0-or-later

Unpacked Size

40.9 kB

Total Files

6

Last publish

Collaborators

  • emmercm