Repository navigation
fix: keep escaped commas inside CSS selectors - #11463
Merged
Merged
Conversation
|
View your CI Pipeline Execution ↗ for commit 22c23bd
💡 Verify your cache is correct by running tasks in a sandbox. Read docs ↗ ☁️ Nx Cloud last updated this comment at |
commit: |
triniwiz
force-pushed
the
fix/css-escaped-comma-selectors
branch
from
September 28, 2026 04:56
400f7ee to
ed90c7b
Compare
…rsers Application.addCss, component css and HMR css updates parse at runtime and split Tailwind arbitrary-value selectors the same way the build-time parsers did.
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.
PR Checklist
What is the current behavior?
Both CSS pipelines (
@nativescript/vite's main entry and@nativescript/webpack'scss2json-loader) parse withcss, which splits a rule's selector list on every comma outside parentheses and counts an escaped\(as a parenthesis. An escaped comma inside a class name therefore splits the class in two. For example, Tailwind'sgrid-cols-[repeat(auto-fill,minmax(260px,1fr))]compiles to.grid-cols-\[repeat\(auto-fill\,minmax\(260px\,1fr\)\)\], which is parsed as two selectors that match nothing, so the rule never applies. This affects every platform.What is the new behavior?
After parsing, selector pieces that end on an escaped comma (an odd number of trailing backslashes) are joined back to the next piece, including in rules nested under
@mediaand similar at-rules. Real selector lists and escaped backslashes are unchanged.Tests:
packages/vite/helpers/css-ast.spec.ts(4) andpackages/webpack5/__tests__/loaders/css2json-loader.spec.ts(3), using real Tailwind output, a genuine selector list, an escaped backslash and a nested@media. Without the fix, the rawcssparse splits the selector.