-
Notifications
You must be signed in to change notification settings - Fork 25.5k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
bug(platform-server): dynamic styles do not get converted from camelCase to kebab-case #19235
Comments
Can confirm on v4.4.1 and v 5.0.0-beta.7
As a work around you can do To Reproduce:
|
It looks like the problem is here: angular/packages/platform-server/src/parse5_adapter.ts Lines 457 to 472 in 6279e50
In the browser implementation, the code looks like this, where the style is applied directly to the element, thus leveraging the browser's implicit transformation from camel case to dash case: angular/packages/platform-browser/src/dom/dom_renderer.ts Lines 182 to 189 in 1092292
|
Is any Body looking into this? |
If @vikerman is too swamped, I can probably get a PR in early next week. But I think he's the only one assigned at the moment. |
* Add correct mapping from camel case to kebab case for CSS style names * Remove internal CSS methods in favor of native Domino APIs Fixes angular#19235
* Add correct mapping from camel case to kebab case for CSS style names * Remove internal CSS methods in favor of native Domino APIs Fixes angular#19235
…ngular#22263) * Add correct mapping from camel case to kebab case for CSS style names * Remove internal CSS methods in favor of native Domino APIs Fixes angular#19235 PR Close angular#22263
…ngular#22263) * Add correct mapping from camel case to kebab case for CSS style names * Remove internal CSS methods in favor of native Domino APIs Fixes angular#19235 PR Close angular#22263
This issue has been automatically locked due to inactivity. Read more about our automatic conversation locking policy. This action has been performed automatically by a bot. |
I'm submitting a...
Current behavior
Using HostBinding or NgStyle with platform-server appends the style to the correct element, but does not convert the name of the style to kebab-case as platform-browser does. This leads the browser to not recognize the name of the style.
Expected behavior
The dynamically applied styles should be transferred to the DOM as kebab-case, not camelCase.
Minimal reproduction of the problem with instructions
marginRight
What is the motivation / use case for changing the behavior?
If a user has JS disabled, or if bootstrapping is particularly slow, UX is greatly impacted as styles are not correctly applied throughout the DOM.
Environment
The text was updated successfully, but these errors were encountered: