Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with
or
.
Download ZIP
Remove unused CSS from your Mimosa apps
JavaScript
branch: master

Fetching latest commit…

Cannot retrieve the latest commit at this time

Failed to load latest commit information.
src
.gitignore
.npmignore
README.md
mimosa-config.js
package.json

README.md

mimosa-eslint

Overview

This is a uncss module for the Mimosa build tool. It will remove unused CSS from your projects.

For more information regarding Mimosa, see http://mimosa.io

This module requires Mimosa v2.1.17+.

Usage

Add 'uncss' to your list of modules. That's all! Mimosa will install the module for you when you start mimosa watch or mimosa build.

Functionality

This module will run the uncss against configured .html pages and output a file that contains all of the CSS the the those pages actually use. Any styles not used on the page are left out.

uncss has plenty of options to tweak the optimization, like an ignore option in case some styles have to be forcibly retained. Check the uncss config for more info.

If the --minify flag is used, this module will minify the output CSS.

Default Config

This module will not do anything by default. It must be pointed at .html files to process.

Example Config

uncss: {
  files: [{
    html:["index.html"],
    out:"stylesheets/uncss-ed.css"
  }],
  options: {}
}
  • files: an array of objects
  • files[].html: an array of paths to html files containing CSS to optimize. Path must be relative to watch.compiledDir.
  • files[].out: the CSS file to place the output CSS. Path must be relative to watch.compiledDir.
  • options: All of the uncss config can be provided via this object.
Something went wrong with that request. Please try again.