Skip to content

docs(css): clarify negative lookahead analogy - #45080

Merged
Josh-Cena merged 2 commits into
mdn:mainfrom
fuentez145:docs/issue-45038-negative-lookahead
Aug 11, 2026
Merged

docs(css): clarify negative lookahead analogy#45080
Josh-Cena merged 2 commits into
mdn:mainfrom
fuentez145:docs/issue-45038-negative-lookahead

Conversation

@fuentez145

Copy link
Copy Markdown
Contributor

Summary

Clarifies the limitation of the .abc:has(+ :not(.xyz)) analogy in the negative lookahead section of the :has() documentation. Unlike a regular-expression negative lookahead, the selector does not match when there is no following element.

Related issue

Closes #45038

Test plan

  • markdownlint-cli2 files/en-us/web/css/reference/selectors/_colon_has/index.md
  • prettier --check files/en-us/web/css/reference/selectors/_colon_has/index.md
  • MDN front-matter linter
  • MDN filecheck
  • git diff --check

@fuentez145
fuentez145 requested a review from a team as a code owner August 11, 2026 03:23
@fuentez145
fuentez145 requested review from estelle and removed request for a team August 11, 2026 03:23
@github-actions github-actions Bot added Content:CSS Cascading Style Sheets docs size/xs [PR only] 0-5 LoC changed labels Aug 11, 2026
@github-actions github-actions Bot added size/s [PR only] 6-50 LoC changed and removed size/xs [PR only] 0-5 LoC changed labels Aug 11, 2026

@Josh-Cena Josh-Cena left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thank you. As suggested in the issue, the better fix here is to use :not(:has()) instead.

@Josh-Cena
Josh-Cena merged commit ebc0a01 into mdn:main Aug 11, 2026
8 of 9 checks passed
@github-actions

Copy link
Copy Markdown
Contributor

Preview URLs (1 page)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Content:CSS Cascading Style Sheets docs size/s [PR only] 6-50 LoC changed

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Regexp (?!) CSS selector analogy doesn't hold for last child elements

3 participants