source: trip-planner-front/node_modules/postcss-selector-parser/README.md@ 6c1585f

Last change on this file since 6c1585f was 6a3a178, checked in by Ema <ema_spirova@…>, 3 years ago

initial commit

  • Property mode set to 100644
File size: 1.1 KB
Line 
1# postcss-selector-parser [![Build Status](https://travis-ci.org/postcss/postcss-selector-parser.svg?branch=master)](https://travis-ci.org/postcss/postcss-selector-parser)
2
3> Selector parser with built in methods for working with selector strings.
4
5## Install
6
7With [npm](https://npmjs.com/package/postcss-selector-parser) do:
8
9```
10npm install postcss-selector-parser
11```
12
13## Quick Start
14
15```js
16const parser = require('postcss-selector-parser');
17const transform = selectors => {
18 selectors.walk(selector => {
19 // do something with the selector
20 console.log(String(selector))
21 });
22};
23
24const transformed = parser(transform).processSync('h1, h2, h3');
25```
26
27To normalize selector whitespace:
28
29```js
30const parser = require('postcss-selector-parser');
31const normalized = parser().processSync('h1, h2, h3', {lossless: false});
32// -> h1,h2,h3
33```
34
35Async support is provided through `parser.process` and will resolve a Promise
36with the resulting selector string.
37
38## API
39
40Please see [API.md](API.md).
41
42## Credits
43
44* Huge thanks to Andrey Sitnik (@ai) for work on PostCSS which helped
45 accelerate this module's development.
46
47## License
48
49MIT
Note: See TracBrowser for help on using the repository browser.