You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
[css] Wrong selector hover when using :has() #191897
bugIssue identified by VS Code Team member as probable bugcss-less-scssIssues and items concerning CSS,Less,SCSS stylinghelp wantedIssues identified as good community contribution opportunities
Thanks for creating this issue! It looks like you may be using an old version of VS Code, the latest stable release is 1.81.1. Please try upgrading to the latest version and checking whether this issue remains.
Hi Martin Aeschlimann (@aeschli), I'd like to work on this. Before changing anything, I want to check the intended output, since selectorPrinting.test.ts currently asserts <element id="s12" :has>.
Proposal for :has(): render the argument as a descendant of the subject element, e.g. article:has(.alert) →
<article>
…
<elementclass="alert">
and for :has(> .alert) show it as a direct child (no …). For a selector list like :has(.a, .b) I'd use only the first entry.
bugIssue identified by VS Code Team member as probable bugcss-less-scssIssues and items concerning CSS,Less,SCSS stylinghelp wantedIssues identified as good community contribution opportunities
Activity
vscodenpa commentedon Aug 31, 2023
Thanks for creating this issue! It looks like you may be using an old version of VS Code, the latest stable release is 1.81.1. Please try upgrading to the latest version and checking whether this issue remains.
Happy Coding!
[-]Wrong HTML example when using CSS :has() [/-][+][css] Wrong selector hover when using :has() [/+]UsmanQT commentedon Nov 14, 2026
Hi Martin Aeschlimann (@aeschli), I'd like to work on this. Before changing anything, I want to check the intended output, since
selectorPrinting.test.tscurrently asserts<element id="s12" :has>.Proposal for
:has(): render the argument as a descendant of the subject element, e.g.article:has(.alert)→and for
:has(> .alert)show it as a direct child (no…). For a selector list like:has(.a, .b)I'd use only the first entry.For
:not(),:is()and:where()I'd leave the current rendering alone in this change (microsoft/vscode-css-languageservice#169 covers:not()separately).Does that match what you'd accept? If so I'll open a PR in vscode-css-languageservice with updated tests.