Skip to content
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

[css] Support CSS :has() pseudo-class #147353

Closed
BenjaminAster opened this issue Apr 13, 2022 · 3 comments · Fixed by microsoft/vscode-css-languageservice#279
Closed

[css] Support CSS :has() pseudo-class #147353

BenjaminAster opened this issue Apr 13, 2022 · 3 comments · Fixed by microsoft/vscode-css-languageservice#279
Assignees
Labels
css-less-scss Issues and items concerning CSS,Less,SCSS styling feature-request Request for new features or functionality verification-needed Verification of issue is requested verified Verification succeeded

Comments

@BenjaminAster
Copy link

With the new CSS functional pseudo class :has(), you can start a selector function with >, + or ~ (see specification). However, VSCode shows a syntax error when using these.

.foo:has(> .bar) {
	/* selects all foos that have a bar as a direct child */
	/* ==> syntax error in VSCode */
}

.foo:has(+ .bar) {
	/* selects all foos that are immediately followed by a bar */
	/* ==> syntax error in VSCode */
}

.foo:has(~ .bar) {
	/* selects all foos that are followerd by a bar */
	/* ==> syntax error in VSCode */
}
@aeschli aeschli added feature-request Request for new features or functionality help wanted Issues identified as good community contribution opportunities labels Apr 25, 2022
@aeschli aeschli added this to the On Deck milestone Apr 25, 2022
@taroken6
Copy link

Hi @aeschli
I'd like to take a shot at this

@aeschli
Copy link
Contributor

aeschli commented Jun 28, 2022

@taroken6 Cool, the code is in https://github.com/microsoft/vscode-css-languageservice.

The code to adopt is around here: https://github.com/microsoft/vscode-css-languageservice/blob/main/src/parser/cssParser.ts#L1409

See the readme for guidance how to run the tests.

@ExE-Boss
Copy link
Contributor

ExE-Boss commented Jul 1, 2022

Duplicate of microsoft/vscode-css-languageservice#250

@aeschli aeschli modified the milestones: On Deck, September 2022 Sep 1, 2022
@aeschli aeschli added css-less-scss Issues and items concerning CSS,Less,SCSS styling and removed help wanted Issues identified as good community contribution opportunities labels Sep 1, 2022
@aeschli aeschli added the verification-needed Verification of issue is requested label Sep 26, 2022
@lramos15 lramos15 added the verified Verification succeeded label Sep 28, 2022
@github-actions github-actions bot locked and limited conversation to collaborators Oct 17, 2022
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
css-less-scss Issues and items concerning CSS,Less,SCSS styling feature-request Request for new features or functionality verification-needed Verification of issue is requested verified Verification succeeded
Projects
None yet
Development

Successfully merging a pull request may close this issue.

5 participants