Share your code. npm Orgs help your team discover, share, and reuse code. Create a free org »

    rework-only-childpublic

    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

    4

    version

    0.0.1

    license

    MIT

    repository

    githubgithub

    last publish

    collaborators

    • avatar