Skip to content

Resolve interpolated CSS-variable property names#388

Merged
skovhus merged 4 commits intomainfrom
cursor/bail-css-var-property-name-323a
Apr 20, 2026
Merged

Resolve interpolated CSS-variable property names#388
skovhus merged 4 commits intomainfrom
cursor/bail-css-var-property-name-323a

Conversation

@skovhus
Copy link
Copy Markdown
Owner

@skovhus skovhus commented Apr 20, 2026

When a styled component sets a CSS variable via interpolation (e.g. ${ITEM_MIN_WIDTH_VAR}: 100%;), resolve the slot to its static string value (direct literal or top-level const NAME = "...") and emit a proper "--item-min-width": "100%" entry. Bail with Unsupported interpolation: property only when the name cannot be resolved or doesn't look like a CSS custom property.

Open in Web Open in Cursor 

Co-authored-by: Kenneth Skovhus <skovhus@users.noreply.github.com>
@github-actions
Copy link
Copy Markdown
Contributor

github-actions bot commented Apr 20, 2026

PR Preview Action v1.8.1

🚀 View preview at
https://skovhus.github.io/styled-components-to-stylex-codemod/pr-preview/pr-388/

Built to branch gh-pages at 2026-04-20 15:46 UTC.
Preview will be ready when the GitHub Pages deployment is complete.

Co-authored-by: Kenneth Skovhus <skovhus@users.noreply.github.com>
@cursor cursor bot changed the title Bail when styled CSS sets a CSS variable via interpolation Resolve interpolated CSS-variable property names Apr 20, 2026
@skovhus skovhus marked this pull request as ready for review April 20, 2026 15:30
Copy link
Copy Markdown

@chatgpt-codex-connector chatgpt-codex-connector bot left a comment

Choose a reason for hiding this comment

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

💡 Codex Review

Here are some automated review suggestions for this pull request.

Reviewed commit: 53ca1857ae

ℹ️ 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".

Comment thread src/internal/lower-rules/process-rule-declarations.ts
cursoragent and others added 2 commits April 20, 2026 15:35
Co-authored-by: Kenneth Skovhus <skovhus@users.noreply.github.com>
Co-authored-by: Kenneth Skovhus <skovhus@users.noreply.github.com>
@skovhus skovhus merged commit e9a907e into main Apr 20, 2026
6 checks passed
@skovhus skovhus deleted the cursor/bail-css-var-property-name-323a branch April 20, 2026 16:03
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.

2 participants