Closed
Description
Expected Behaviour
The content of the :is()
is a selector itself ( https://developer.mozilla.org/en-US/docs/Web/CSS/:is )
Actual Behaviour
Currently, parsing selector as in the following code split the selector with the ,
which doesn't work
Reproduce Scenario (including but not limited to)
Using a :is()
with a ,
inside the parenthesis
Steps to Reproduce
Platform and Version
Linux, Node 18
Sample Code that illustrates the problem
import {parse} from "@adobe/css-tools";
console.dir(await parse('.klass:is(:nth-child(1), :nth-child(2)) {margin: 0 !important}'), { depth: 4 });
Logs taken while reproducing problem
yarn node test.js
{
type: 'stylesheet',
stylesheet: {
source: undefined,
rules: [
{
type: 'rule',
selectors: [ '.klass:is(:nth-child(1)', ':nth-child(2))' ],
declarations: [ [Object] ],
position: $0865a9fb4cc365fe$export$2e2bcd8739ae039 {
start: [Object],
end: [Object],
source: ''
}
}
],
parsingErrors: []
}
}