Skip to content

fix: reject selector lists directly inside scope markers - #93

Open
Cynnamoroll wants to merge 1 commit into
css-modules:masterfrom
Cynnamoroll:fix/reject-scoped-selector-lists
Open

Cynnamoroll wants to merge 1 commit into
css-modules:masterfrom
Cynnamoroll:fix/reject-scoped-selector-lists

Conversation

@Cynnamoroll

Copy link
Copy Markdown

Fixes #92.

:global(.g, .h) currently emits .g .h, while :global(.g,.h) emits .g.h. Neither matches the two alternatives in the source. The same flattening happens in :local().

Reject a selector list directly inside either scope marker rather than silently changing which elements match. Use :global(.g), :global(.h) for separate alternatives. Native selector lists nested inside a marker, such as :global(:is(.g, .h)), remain valid. The change does not attempt to expand selector lists or change specificity.

Added tests for both markers, an @scope prelude and a valid nested :is(). All 253 tests, ESLint and Prettier passed. A CSS Modules consumer and Chromium confirmed the original descendant/compound mismatch and unchanged CSS, exports and DOM matches for six valid controls.

AI-assisted implementation and validation.

Co-authored-by: factory-droid[bot] <138933559+factory-droid[bot]@users.noreply.github.com>
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.

:global(.a, .b) and :local(.a, .b) turn the selector list into a descendant/compound selector

1 participant