Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP
Clone module for Rework
JavaScript CSS
branch: master

0.1.3

latest commit 3bc5505618
@isqua authored
Failed to load latest commit information.
test
.gitignore
.npmignore
.travis.yml
LICENSE
README.md
index.js
package.json

README.md

rework-clone

NPM version Build status devDependency status peerDependency status

This module clones properties from one rule set to another, unlike rework-inherit (rework.extend()) which concatenates the selectors.

Don’t copy anything and everything! Think when you need to inherit and when to clone.

Example

.a {
  background: red
}
.b {
  clone: .a;
}

yields:

.a {
  background: red;
}
.b {
  background: red;
}

Usage

var clone = require('rework-clone');

var css = rework(inputCSS)
  .use(clone(options))
  .toString();

Options

This is only one option: regexp to replace.

var css = rework(inputCSS)
  .use(clone({regexp: /^foo?$/}))
  .toString();

It will work with all foo properties.

License

MIT

Something went wrong with that request. Please try again.