Skip to content

Should ::part() be a String instead of a Selector? #47

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Open
WilcoFiers opened this issue Mar 27, 2025 · 1 comment · May be fixed by #48
Open

Should ::part() be a String instead of a Selector? #47

WilcoFiers opened this issue Mar 27, 2025 · 1 comment · May be fixed by #48

Comments

@WilcoFiers
Copy link

I noticed this change added recently:
6dbe132

Looking over the spec ::part() takes a space separated list of identifiers, not a CSS selector. I think those probably could be parsed as a selector, but that doesn't seem to be the intent.

I was hoping I could correct it by adding String: ['part'] but this results in a Conflicting pseudo-class argument type: "Selector" vs "String". error. Is there a way to remove an pseudo element from a particular type that I'm not seeing, or is this extend method only additive? The syntax definitions don't seem to be exported so I can't modify them manually either.

@mdevils
Copy link
Owner

mdevils commented Mar 27, 2025

Hello @WilcoFiers , nice catch.

Feel free to open a PR to fix this.

Remove it from here: https://github.com/mdevils/css-selector-parser/blob/master/src/syntax-definitions.ts#L406

And change from Selector: ['part'] to String: ['part'] here: https://github.com/mdevils/css-selector-parser/blob/master/src/syntax-definitions.ts#L492

@WilcoFiers WilcoFiers linked a pull request Mar 27, 2025 that will close this issue
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants