fix: resolve duplicate theme variables in CSS modules#97
fix: resolve duplicate theme variables in CSS modules#97
Conversation
There was a problem hiding this comment.
💡 Codex Review
Here are some automated review suggestions for this pull request.
Reviewed commit: a9a4b80a77
ℹ️ About Codex in GitHub
Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you
- Open a pull request for review
- Mark a draft as ready
- Comment "@codex review".
If Codex has suggestions, it will comment; otherwise it will react with 👍.
Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".
src/postcss.ts
Outdated
| root.prepend( | ||
| new AtRule({ | ||
| name: 'import', | ||
| name: 'reference', |
There was a problem hiding this comment.
Preserve theme import for CSS-only pipelines
Replacing the injected at-rule with @reference stops the theme stylesheet from emitting any CSS in PostCSS-processed files, which is a regression for builds that don’t go through the JS/TS virtual-utilities path. In this repo, the fallback real theme import is in createCompiler (src/compiler.ts) but that compiler is only reached via the JS/TS transform hook (api.transform in src/index.ts), so CSS-only entries (or plain CSS rules provided through the theme import chain) can lose their :root variables/rules entirely after this change.
Useful? React with 👍 / 👎.
… fix css modules dedup without breaking global css
Summary
@referenceinstead of@importfor theme variables to resolve CSS modules duplication issues.