Skip to content

Reject class and ID selectors without a name - #369

Merged
MoOx merged 2 commits into
postcss:mainfrom
Aschenbath:fix/oss20-20261123-1909b-selector-empty-names
Nov 26, 2026
Merged

MoOx merged 2 commits into
postcss:mainfrom
Aschenbath:fix/oss20-20261123-1909b-selector-empty-names

Conversation

@Aschenbath

Copy link
Copy Markdown
Contributor

A bare . or # currently produces an AST node with an empty name. Reject these segments through the parser's source-aware error path, including when they occur in compound selectors, selector lists, or pseudo-class arguments.

Fixes #203.

Validation: the 12 new regression cases fail before the fix. npm test passes (lint, public type checking, full tests, and coverage gates); existing escaped punctuation, interpolation, and fractional keyframe cases continue to pass.

Developed with AI assistance; the diff and regression results were reviewed.

@MoOx
MoOx merged commit 4e106ea into postcss:main Nov 26, 2026
4 checks passed
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 this pull request may close these issues.

broken ast for # and .

2 participants