Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP
Collection of "pure CSS" plugins for Rework

4.0.0

The new version of 'rework-suit-conformance' results in a breaking
change. Existing component variables that don't start with the
component's name will result in an error.
latest commit c0b2ad3d75
Nicolas Gallagher necolas authored
Failed to load latest commit information.
test Update 'rework-npm' to ^1.0.0
.gitignore v0.1.0
.jshintrc Add indentation lint setting
.travis.yml v0.1.0
CHANGELOG.md 4.0.0
LICENSE.md v0.1.0
README.md Fix broken link in README
index.js Update 'rework-npm' to ^1.0.0
package.json 4.0.0

README.md

rework-suit

Build Status

A Rework plugin for use with SUIT CSS.

Installation

Install with npm:

npm install --save-dev rework-suit

Use

As a Rework plugin:

var css = fs.readFileSync('build/build.css', 'utf8').toString();

var processed = rework(css)
  .use(suit(options))
  .toString();

Where options has properties alias, root, and shim corresponding to the options available in rework-npm.

Features

Original:

@import "normalize.css";

@custom-media --narrow-viewport all and (min-width:300px);

:root {
  --color: green;
  --width: 100px;
}

@media (--narrow-viewport) {
  .example {
    /* simple variable */
    color: var(--color);
    /* variable with fallback */
    outline: var(--outline, 1px solid red);
    /* calc */
    width: calc(var(--width) * 2);
  }
}

yields:

/* …inlined normalize.css source code… */

@media all and (min-width:300px) {
  .example {
    /* simple variable */
    color: green;
    /* variable with fallback */
    outline: 1px solid red;
    /* calc */
    width: 200px;
  }
}

Testing

Install all dependencies and run the tests:

npm install && npm test

Watch and re-run the tests:

npm run watch
Something went wrong with that request. Please try again.