Skip to content

Clone module for Rework

License

Notifications You must be signed in to change notification settings

meritt/rework-clone

 
 

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

13 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

rework-clone

Build 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

About

Clone module for Rework

Resources

License

Stars

Watchers

Forks

Packages

No packages published

Languages

  • JavaScript 62.3%
  • CSS 37.7%