rework-only-child
v0.0.1
Published
A rework implementation of the :only-child pseudo-selector based off CSS Selectors Level 4.
Downloads
47
Maintainers
Readme
Rework Only Child
A rework implementation of the :only-child pseudo-class selector based off CSS Selectors Level 4.
This will convert the :only-child
pseudo-class selector:
.some-class,
.some-other-class:only-child {
color: blue;
}
To the currently compatible equivalent:
.some-class,
.some-other-class:first-child:last-child {
color: blue;
}
Installation
npm install --save rework-only-child
Usage
var fs = require('fs');
var rework = require('rework');
var onlyChild = require('rework-only-child');
var css = fs.readFileSync('css/my-file.css', 'utf8').toString();
var out = rework(css).use(onlyChild()).toString();
License
MIT
Contributing
- Fork it
- Create your feature branch (
git checkout -b my-new-feature
) - Commit your changes (
git commit -am 'Add some feature'
) - Push to the branch (
git push origin my-new-feature
) - Create new Pull Request
Crafted with <3 by John Otander (@4lpine).