Last change
on this file since 76712b2 was 6a3a178, checked in by Ema <ema_spirova@…>, 3 years ago |
initial commit
|
-
Property mode
set to
100644
|
File size:
1018 bytes
|
Rev | Line | |
---|
[6a3a178] | 1 | # postcss-selector-not [![CSS Standard Status](https://cssdb.org/badge/not-pseudo-class.svg)](https://cssdb.org/#not-pseudo-class) [![Build Status](https://travis-ci.org/postcss/postcss-selector-not.svg?branch=master)](https://travis-ci.org/postcss/postcss-selector-not)
|
---|
| 2 |
|
---|
| 3 | > PostCSS plugin to transform `:not()` W3C CSS level 4 pseudo class to :not() CSS level 3 selectors
|
---|
| 4 |
|
---|
| 5 | http://dev.w3.org/csswg/selectors-4/#negation
|
---|
| 6 |
|
---|
| 7 | [!['Can I use' table](https://caniuse.bitsofco.de/image/css-not-sel-list.png)](https://caniuse.com/#feat=css-not-sel-list)
|
---|
| 8 |
|
---|
| 9 | ## Installation
|
---|
| 10 |
|
---|
| 11 | ```console
|
---|
| 12 | $ npm install postcss-selector-not
|
---|
| 13 | ```
|
---|
| 14 |
|
---|
| 15 | ## Usage
|
---|
| 16 |
|
---|
| 17 | ```js
|
---|
| 18 | var postcss = require("postcss")
|
---|
| 19 |
|
---|
| 20 | var output = postcss()
|
---|
| 21 | .use(require("postcss-selector-not"))
|
---|
| 22 | .process(require("fs").readFileSync("input.css", "utf8"))
|
---|
| 23 | .css
|
---|
| 24 | ```
|
---|
| 25 |
|
---|
| 26 | Using this `input.css`:
|
---|
| 27 |
|
---|
| 28 | ```css
|
---|
| 29 | p:not(:first-child, .special) {
|
---|
| 30 | color: red;
|
---|
| 31 | }
|
---|
| 32 | ```
|
---|
| 33 |
|
---|
| 34 | you will get:
|
---|
| 35 |
|
---|
| 36 | ```css
|
---|
| 37 | p:not(:first-child):not(.special) {
|
---|
| 38 | color: red;
|
---|
| 39 | }
|
---|
| 40 | ```
|
---|
| 41 |
|
---|
| 42 | ---
|
---|
| 43 |
|
---|
| 44 | ## [Changelog](CHANGELOG.md)
|
---|
| 45 |
|
---|
| 46 | ## [License](LICENSE)
|
---|
Note:
See
TracBrowser
for help on using the repository browser.