postcss-selector-parser
postcss-selector-parser copied to clipboard
A CSS selector parser, integrates with postcss but does not require it.
Input: ```css h2 /*test*/ h4 { } /* Here we don't have `comment` node in ast (store comment in `raws`) */ h2/*test*/h4 { } /* Comment in ast */ ```...
Input: ```css [ *|href ] { } ``` After stringify: ``` [*|href ] { } ``` We lose space before namespace
Example: ``` combinatorNode.value = " "; ``` Doesn't work, stringifier still use `combinatorNode.raws.value` value
Not sure if this is by design or not but I expected after #133 that class names would be escaped by default when creating a new className node. ```js const...
```js parser .pseudo({ value: ':not', nodes: [ selectorParser.selector({ nodes: [selectorParser.tag({ value: 'span' })], spaces: { before: ' ', after: ' ' }, }), selectorParser.selector({ nodes: [selectorParser.tag({ value: 'span' })], spaces:...
I am using postcss-preset-env which use this plugin and I am getting a parsing error when I have a "complex" custom property. When a css file hat the following code:...
The following code: ```js import parser from 'postcss-selector-parser'; const { process } = parser(); process('button:not([disabled])'); ``` Produces the following error: ``` TypeError: Cannot read property '_run' of undefined at process...
1. add a strict parse mode so that any non-standard syntax is an immediate error. 2. When not strict, it should be possible to find which nodes contain non standard...
Another `nth-child` problem ... Given the selector `.foo:nth-child(2n + 1)`, the parser thinks that plus sign is a combinator. Given the selector `.foo:nth-child(2n - 1)`, the parser thinks the spaces...