fix(compiler): support dots in class binding names - #71137
Open
vslipchenko wants to merge 1 commit into
Open
vslipchenko wants to merge 1 commit into
vslipchenko wants to merge 1 commit into
Conversation
vslipchenko
force-pushed
the
fix-class-binding-dotted-names
branch
from
October 2, 2026 14:36
5cf0db0 to
0198ee2
Compare
JeanMeche
approved these changes
Oct 2, 2026
JeanMeche
left a comment
Member
There was a problem hiding this comment.
AGENT: Looks good to me. The fix for dot truncation in CLASS_DOT class bindings is correct and well-tested.
vslipchenko
force-pushed
the
fix-class-binding-dotted-names
branch
from
October 2, 2026 15:15
0198ee2 to
b53fa41
Compare
Member
|
Can you please also check that the vscode-language-service integration also works. |
Treat everything after the `class.` prefix as the class name, both in template bindings and in `host` bindings. Previously the name was cut at the next dot, so a binding like `[class.px-3.5]` silently applied `px-3` instead of `px-3.5`. This made single class bindings unusable with class names that contain a dot, which are common in Tailwind.
vslipchenko
force-pushed
the
fix-class-binding-dotted-names
branch
from
October 2, 2026 15:57
b53fa41 to
d0ef3b9
Compare
Contributor
Author
Member
|
Great it looks fine. To make sure we won't break anything I'll run some extended tests (TGP) on Google's codebase over the weekend. |
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.


Class bindings cut the class name at the first dot after the
class.prefix, so a binding like[class.px-3.5]="condition"silently appliespx-3instead ofpx-3.5. No error or warning is reported. The same happens forhostbindings, e.g.host: {'[class.py-2.5]': 'condition'}appliespy-2.This makes single class bindings unusable with class names that contain a dot, which are common in Tailwind (
px-3.5,w-1.5,gap-0.5).Background
[class.px-3.5]renders aspx-3(syntax highlighting issue with class binding and tailwind classes聽#67679 (comment)).vscode-ng-language-service/syntaxes/, so the rendering behavior described in that comment was not changed and is not tracked by an open issue./,:,[...]), andattr.bindings already keep everything after the prefix. Dots in class names were the remaining gap.PR Checklist
Please check if your PR fulfills the following requirements:
PR Type
What kind of change does this PR introduce?
What is the current behavior?
[class.px-3.5]="true"adds the classpx-3.Issue Number: N/A (reported in a comment on #67679)
What is the new behavior?
[class.px-3.5]="true"adds the classpx-3.5.Does this PR introduce a breaking change?
Other information