Title: Custom property style bindings ignore static and `[style]` values of same name since 22.1 · Issue #71806 · angular/angular · GitHub
Open Graph Title: Custom property style bindings ignore static and `[style]` values of same name since 22.1 · Issue #71806 · angular/angular
X Title: Custom property style bindings ignore static and `[style]` values of same name since 22.1 · Issue #71806 · angular/angular
Description: Which @angular/* package(s) are the source of the bug? compiler Is this a regression? Yes, works in 22.0.8, broken in 22.2.4 and 22.3.0-next.3. Came with #68846 Description Hit this in my ui lib, had to move component inputs to separate ...
Open Graph Description: Which @angular/* package(s) are the source of the bug? compiler Is this a regression? Yes, works in 22.0.8, broken in 22.2.4 and 22.3.0-next.3. Came with #68846 Description Hit this in my ui lib, h...
X Description: Which @angular/* package(s) are the source of the bug? compiler Is this a regression? Yes, works in 22.0.8, broken in 22.2.4 and 22.3.0-next.3. Came with #68846 Description Hit this in my ui lib, h...
Opengraph URL: https://github.com/angular/angular/issues/71806
X: @github
Domain: github.com
{"@context":"https://schema.org","@type":"DiscussionForumPosting","headline":"Custom property style bindings ignore static and `[style]` values of same name since 22.1","articleBody":"### Which @angular/* package(s) are the source of the bug?\n\ncompiler\n\n### Is this a regression?\n\nYes, works in 22.0.8, broken in 22.2.4 and 22.3.0-next.3. Came with #68846\n\n### Description\n\nHit this in my ui lib, had to move component inputs to separate variable\n\n`[style.--x]` compiles to key `--%NS%x`, but static `style=\"--x: red\"` and `[style]=\"'--x: red'\"` keep `--x`. Styling priority looks values up by key, so these never mathc and binding stops seeing value of same name. `[style.color]` is not affected. No `provideCssVarNamespacing()` needed to hit this\n\n- host binding `[style.--x]` now overwrites value author set on component element, before author won\n- `undefined` no longer falls back to static or `[style]` value, element ends up without `--x`\n\n| case | bound value | 22.0.8 | 22.2.4 | same case with `color`, 22.2.4 |\n|---|---|---|---|---|\n| `\u003cmy-cmp style=\"--x: red\">` + host `[style.--x]` | `blue` | `--x: red` | `--x: blue` | `color: red` |\n| `\u003cmy-cmp style=\"--x: red\">` + host `[style.--x]` | `undefined` | `--x: red` | empty | `color: red` |\n| `\u003ci style=\"--x: red\" [style.--x]=\"v\">` | `undefined` | `--x: red` | empty | `color: red` |\n| `\u003ci [style]=\"'--x: red'\" [style.--x]=\"v\">` | `undefined` | `--x: red` | empty | `color: red` |\n| host `style: '--x: red'` + host `[style.--x]` | `undefined` | `--x: red` | empty | `color: red` |\n\nWith `provideCssVarNamespacing('ns')` both stay on element: `--x: red; --ns_x: blue`\n\n### Please provide a link to a minimal reproduction of the bug\n\n```ts\n@Component({ selector: 'my-cmp', template: '', host: { '[style.--x]': 'v' } })\nclass MyCmp {\n @Input() v?: string;\n}\n\n@Component({ selector: 'app-root', imports: [MyCmp], template: `\u003cmy-cmp style=\"--x: red\" v=\"blue\" />` })\nclass App {}\n```\n\n`getAttribute('style')` on `my-cmp`: `--x: red` in 22.0.8, `--x: blue` in 22.2.4 and 22.3.0-next.3\n\n### Please provide the exception or error you saw\n\nNone\n\n### Please provide the environment you discovered this bug in (run `ng version`)\n\n@angular/core 22.0.8, 22.2.4 and 22.3.0-next.3, Chromium, JIT\n\n### Anything else?\n\nCompliance golden `style_bindings/css_custom_properties.js` shows same split: `--camel-case` in consts, `--%NS%camelCase` in `ɵɵstyleProp`\n","author":{"url":"https://github.com/thekhegay","@type":"Person","name":"thekhegay"},"datePublished":"2026-11-04T14:28:50Z","url":"https://github.com/angular/angular/issues/71806"}
| react-profiling | 0 |
| react-import-map | react,react-dom,react-dom/client,react-dom/profiling,react-is,react/compiler-runtime,react/jsx-dev-runtime,react/jsx-runtime,scheduler@b8488ee2c322 |
| route-pattern | /_view_fragments/issues/show/:user_id/:repository/:id/issue_layout(.:format) |
| route-controller | voltron_issues_fragments |
| route-action | issue_layout |
| fetch-nonce | v2:8ba42237-1ddc-55b9-ff11-9009b4444319 |
| current-catalog-service-hash | 81bb79d38c15960b92d99bca9288a9108c7a47b18f2423d0f6438c5b7bcd2114 |
| request-id | C7CE:27E5CD:35834E6:4474FC4:6B01DB9F |
| html-safe-nonce | 9cca4044dbb56d36a2581eeed5a0dabcb28f59e31bd889a2df07e09cd5ae47c8 |
| visitor-payload | eyJyZWZlcnJlciI6IiIsInJlcXVlc3RfaWQiOiJDN0NFOjI3RTVDRDozNTgzNEU2OjQ0NzRGQzQ6NkIwMURCOUYiLCJ2aXNpdG9yX2lkIjoiMzEyMTAyMjcwMDM0NjMxNTgzIiwicmVnaW9uX2VkZ2UiOiJpYWQiLCJyZWdpb25fcmVuZGVyIjoiaWFkIn0= |
| visitor-hmac | aa50ecceb52b311ef00602911a516623e2ace7dd37d18421d8ad25e9578c808a |
| hovercard-subject-tag | issue:6204754772 |
| github-keyboard-shortcuts | repository,issues,copilot |
| google-site-verification | Apib7-x98H0j5cPqHWwSMm6dNU4GmODRoqxLiDzdx9I |
| octolytics-url | https://collector.github.com/github/collect |
| analytics-location | / |
| fb:app_id | 1401488693436528 |
| apple-itunes-app | app-id=1477376905, app-argument=https://github.com/_view_fragments/issues/show/angular/angular/71806/issue_layout |
| twitter:image | https://opengraph.githubassets.com/f64eb7b113e3bcfba4d0634b49b52782f72373ce95193c8c1850eb85fe916846/angular/angular/issues/71806 |
| twitter:card | summary_large_image |
| og:image | https://opengraph.githubassets.com/f64eb7b113e3bcfba4d0634b49b52782f72373ce95193c8c1850eb85fe916846/angular/angular/issues/71806 |
| og:image:alt | Which @angular/* package(s) are the source of the bug? compiler Is this a regression? Yes, works in 22.0.8, broken in 22.2.4 and 22.3.0-next.3. Came with #68846 Description Hit this in my ui lib, h... |
| og:image:width | 1200 |
| og:image:height | 600 |
| og:site_name | GitHub |
| og:type | object |
| og:author:username | thekhegay |
| hostname | github.com |
| expected-hostname | github.com |
| None | cc5dfdd32f62ebd3223cab3af3aa2b268d3605218237326a48a99d1efd89495c |
| turbo-cache-control | no-preview |
| go-import | github.com/angular/angular git https://github.com/angular/angular.git |
| octolytics-dimension-user_id | 139426 |
| octolytics-dimension-user_login | angular |
| octolytics-dimension-repository_id | 24195339 |
| octolytics-dimension-repository_nwo | angular/angular |
| octolytics-dimension-repository_public | true |
| octolytics-dimension-repository_is_fork | false |
| octolytics-dimension-repository_network_root_id | 24195339 |
| octolytics-dimension-repository_network_root_nwo | angular/angular |
| turbo-body-classes | logged-out env-production page-responsive |
| disable-turbo | false |
| browser-stats-url | https://api.github.com/_private/browser/stats |
| browser-errors-url | https://api.github.com/_private/browser/errors |
| release | 8c77c9e8439031ad54c75a250694842892f693e1 |
| ui-target | full |
| theme-color | #1e2327 |
| color-scheme | light dark |
| react-app-name | issues |
Links:
Viewport: width=device-width