RG-2791 Alias imported active to prevent its collisions with :active - #9353
Merged
Aleksei Berezkin (aleksei-berezkin) merged 1 commit intoJul 22, 2026
Merged
Conversation
Copilot started reviewing on behalf of
Aleksei Berezkin (aleksei-berezkin)
July 22, 2026 12:56
View session
Andrey Skladchikov (andrey-skl)
approved these changes
Jul 22, 2026
Contributor
There was a problem hiding this comment.
Pull request overview
This PR addresses a CSS Modules @value token-collision issue where importing a symbol named active can inadvertently rewrite the :active pseudo-class due to token-based replacement. The fix aliases the imported active symbol in affected stylesheets, preserving correct :active behavior while keeping class selectors functionally equivalent.
Changes:
- Aliased imported
activeinbutton-group.csstobuttonActiveand updated selectors to use the alias. - Aliased imported
activeinheader.csstolinkActiveand updated selectors to use the alias.
Reviewed changes
Copilot reviewed 2 out of 2 changed files in this pull request and generated no comments.
| File | Description |
|---|---|
| src/header/header.css | Aliases imported active to linkActive and updates selectors to avoid :active token collisions. |
| src/button-group/button-group.css | Aliases imported active to buttonActive and updates selectors to prevent unintended :active rewriting. |
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
Aleksei Berezkin (aleksei-berezkin)
enabled auto-merge (squash)
July 22, 2026 13:01
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
In the prebuilt
style.css,:activepseudo-class is wrongly rewritten to:ring-button-activefor button groups.The problem occurs because
button-group.cssimportsactivefrombutton.css:This makes
activea local imported symbol. In the CSS Modules: Values, symbol replacement is token-based and applies not only to class names, but also to selector and at-rule tokens. As a result,:activecan be rewritten incorrectly. This is a known behavior limitation; see e.g. css-modules/postcss-modules-values#4.This PR introduces the workaround, which is simply to import the symbol under an alias:
and then use that alias instead of
.activein class selectors. This keeps:activeuntouched.The same workaround was also applied to
header.css, which importsactivefromlink.css. That file has not shown errors so far, but the alias was added for consistency and to prevent similar collisions in the future.