source: frontend/node_modules/postcss-selector-not/README.md

Last change on this file was 9af201e, checked in by MBK <marija.karapandzova@…>, 12 days ago

Fix frontend appearance

  • Property mode set to 100644
File size: 2.3 KB
Line 
1# PostCSS Selector Not [<img src="https://postcss.github.io/postcss/logo.svg" alt="PostCSS Logo" width="90" height="90" align="right">][postcss]
2
3[<img alt="npm version" src="https://img.shields.io/npm/v/postcss-selector-not.svg" height="20">][npm-url] [<img alt="CSS Standard Status" src="https://cssdb.org/images/badges/not-pseudo-class.svg" height="20">][css-url] [<img alt="Build Status" src="https://github.com/csstools/postcss-plugins/workflows/test/badge.svg" height="20">][cli-url] [<img alt="Discord" src="https://shields.io/badge/Discord-5865F2?logo=discord&logoColor=white">][discord]
4
5[PostCSS Selector Not] transforms :not() W3C CSS level 4 pseudo classes to :not() CSS level 3 selectors following the [Selectors 4 Specification].
6
7```pcss
8p:not(:first-child, .special) {
9 color: red;
10}
11
12/* becomes */
13
14p:not(:first-child):not(.special) {
15 color: red;
16}
17```
18
19⚠️ Only lists of simple selectors (`:not(.a, .b)`) will work as expected.
20Complex selectors (`:not(.a > .b, .c ~ .d)`) can not be downgraded.
21
22## Usage
23
24Add [PostCSS Selector Not] to your project:
25
26```bash
27npm install postcss postcss-selector-not --save-dev
28```
29
30Use it as a [PostCSS] plugin:
31
32```js
33const postcss = require('postcss');
34const postcssSelectorNot = require('postcss-selector-not');
35
36postcss([
37 postcssSelectorNot(/* pluginOptions */)
38]).process(YOUR_CSS /*, processOptions */);
39```
40
41[PostCSS Selector Not] runs in all Node environments, with special
42instructions for:
43
44| [Node](INSTALL.md#node) | [PostCSS CLI](INSTALL.md#postcss-cli) | [Webpack](INSTALL.md#webpack) | [Create React App](INSTALL.md#create-react-app) | [Gulp](INSTALL.md#gulp) | [Grunt](INSTALL.md#grunt) |
45| --- | --- | --- | --- | --- | --- |
46
47[cli-url]: https://github.com/csstools/postcss-plugins/actions/workflows/test.yml?query=workflow/test
48[css-url]: https://cssdb.org/#not-pseudo-class
49[discord]: https://discord.gg/bUadyRwkJS
50[npm-url]: https://www.npmjs.com/package/postcss-selector-not
51
52[Gulp PostCSS]: https://github.com/postcss/gulp-postcss
53[Grunt PostCSS]: https://github.com/nDmitry/grunt-postcss
54[PostCSS]: https://github.com/postcss/postcss
55[PostCSS Loader]: https://github.com/postcss/postcss-loader
56[PostCSS Selector Not]: https://github.com/csstools/postcss-plugins/tree/main/plugins/postcss-selector-not
57[Selectors 4 Specification]: https://www.w3.org/TR/selectors-4/#negation-pseudo
Note: See TracBrowser for help on using the repository browser.