Miss any of our Open RFC calls?Watch the recordings here! »

rework-only-child

0.0.1 • Public • Published

Rework Only Child

Build Status

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

  1. Fork it
  2. Create your feature branch (git checkout -b my-new-feature)
  3. Commit your changes (git commit -am 'Add some feature')
  4. Push to the branch (git push origin my-new-feature)
  5. Create new Pull Request

Crafted with <3 by John Otander (@4lpine).

Install

npm i rework-only-child

DownloadsWeekly Downloads

3

Version

0.0.1

License

MIT

Last publish

Collaborators

  • avatar