The design-token fallback plugins are inconsistent in how they handle var(--wpds-*) references that appear inside string literals (e.g. content: "var(--wpds-border-radius-sm)";) rather than as actual CSS var() functions.
Discovered while reviewing #80401 (comment thread)
Lightning CSS's behavior is already correct:
| Plugin |
Behavior |
| PostCSS |
Regexp-based — matches and rewrites the text anywhere in the declaration, including inside quoted strings. |
| esbuild / Vite |
Skip CSS files but rewrite the same text anywhere in JS/TS source. |
| Lightning CSS |
AST-based — only adds fallbacks to parsed var() functions; leaves plain strings untouched. |
Ask: Align the PostCSS (and esbuild/Vite) plugins in packages/theme/postcss-plugins (and equivalents) to only inject fallbacks for actual var() function references, not incidental text matches inside strings/comments, matching Lightning CSS's AST-aware behavior.
The design-token fallback plugins are inconsistent in how they handle
var(--wpds-*)references that appear inside string literals (e.g.content: "var(--wpds-border-radius-sm)";) rather than as actual CSSvar()functions.Discovered while reviewing #80401 (comment thread)
Lightning CSS's behavior is already correct:
var()functions; leaves plain strings untouched.Ask: Align the PostCSS (and esbuild/Vite) plugins in
packages/theme/postcss-plugins(and equivalents) to only inject fallbacks for actualvar()function references, not incidental text matches inside strings/comments, matching Lightning CSS's AST-aware behavior.