Title: Nested selectors in sass parent selector `&` are not encapsulate properly · Issue #50215 · angular/angular · GitHub
Open Graph Title: Nested selectors in sass parent selector `&` are not encapsulate properly · Issue #50215 · angular/angular
X Title: Nested selectors in sass parent selector `&` are not encapsulate properly · Issue #50215 · angular/angular
Description: Which @angular/* package(s) are the source of the bug? compiler Is this a regression? No Description With the default value of View.encapsulation, nested selectors in sass parent selector & like below are not encapsulate properly. :host ...
Open Graph Description: Which @angular/* package(s) are the source of the bug? compiler Is this a regression? No Description With the default value of View.encapsulation, nested selectors in sass parent selector & like be...
X Description: Which @angular/* package(s) are the source of the bug? compiler Is this a regression? No Description With the default value of View.encapsulation, nested selectors in sass parent selector & lik...
Opengraph URL: https://github.com/angular/angular/issues/50215
X: @github
Domain: github.com
{"@context":"https://schema.org","@type":"DiscussionForumPosting","headline":"Nested selectors in sass parent selector `&` are not encapsulate properly","articleBody":"### Which @angular/* package(s) are the source of the bug?\n\ncompiler\n\n### Is this a regression?\n\nNo\n\n### Description\n\nWith the default value of View.encapsulation, nested selectors in sass parent selector `&` like below are not encapsulate properly.\r\n\r\n```\r\n:host {\r\n dl {\r\n color: blue;\r\n\r\n dt {\r\n font-weight: bold;\r\n text-decoration: underline;\r\n }\r\n }\r\n\r\n &[red] {\r\n dl {\r\n color: red;\r\n\r\n dt {\r\n font-weight: normal;\r\n text-decoration: line-through;\r\n }\r\n }\r\n }\r\n}\r\n```\r\n\r\nGenerated style:\r\n\r\n```\r\n[_nghost-ffs-c12] dl[_ngcontent-ffs-c12]{color:blue}\r\n[_nghost-ffs-c12] dl[_ngcontent-ffs-c12] dt[_ngcontent-ffs-c12]{font-weight:bold;text-decoration:underline}\r\n[red][_nghost-ffs-c12] dl{color:red}\r\n[red][_nghost-ffs-c12] dl dt{font-weight:normal;text-decoration:line-through}\r\n```\r\n\r\nSome attribute selectors are missing, so that styles are applied in the wrong order due to CSS Specificity.\r\n\r\n\u003cimg width=\"813\" alt=\"image\" src=\"https://user-images.githubusercontent.com/54160928/236989283-ea6d0277-1c6b-48b2-b3ed-6b1fdd3cc393.png\">\r\n\r\nExpected style is below (and angular 15.1.1 generate this properly).\r\n\r\n```\r\n[_nghost-ffs-c12] dl[_ngcontent-ffs-c12]{color:blue}\r\n[_nghost-ffs-c12] dl[_ngcontent-ffs-c12] dt[_ngcontent-ffs-c12]{font-weight:bold;text-decoration:underline}\r\n[red][_nghost-ffs-c12] dl[_ngcontent-ffs-c12]{color:red}\r\n[red][_nghost-ffs-c12] dl[_ngcontent-ffs-c12] dt[_ngcontent-ffs-c12]{font-weight:normal;text-decoration:line-through}\r\n```\r\n\r\nangular 15.1.2+ reproduce this behavior.\n\n### Please provide a link to a minimal reproduction of the bug\n\nhttps://stackblitz.com/edit/angular-p2auoh?file=src%2Fsome.component.scss\n\n### Please provide the exception or error you saw\n\n_No response_\n\n### Please provide the environment you discovered this bug in (run `ng version`)\n\n```true\nAngular: 15.1.2\n```\n\n\n### Anything else?\n\nAngular 15.1.1 does not reproduce this.\r\nAngular 16.0.0 reproduce this.\r\n","author":{"url":"https://github.com/koji-nakamura-classi","@type":"Person","name":"koji-nakamura-classi"},"datePublished":"2023-05-09T04:10:10Z","url":"https://github.com/angular/angular/issues/50215"}
| 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:24648a52-f2ac-cb2c-1481-a628a76353da |
| current-catalog-service-hash | 81bb79d38c15960b92d99bca9288a9108c7a47b18f2423d0f6438c5b7bcd2114 |
| request-id | B60E:34DB8F:805178:AD0B51:6B00E2F2 |
| html-safe-nonce | 37b4c2f13e8a795f5bfb99dc806be604e4b26e36e823730358222537d02c8903 |
| visitor-payload | eyJyZWZlcnJlciI6IiIsInJlcXVlc3RfaWQiOiJCNjBFOjM0REI4Rjo4MDUxNzg6QUQwQjUxOjZCMDBFMkYyIiwidmlzaXRvcl9pZCI6IjkxMjIyMzY2NjQ1OTE3MzYxOCIsInJlZ2lvbl9lZGdlIjoiaWFkIiwicmVnaW9uX3JlbmRlciI6ImlhZCJ9 |
| visitor-hmac | b9ba87528f1990afb2ec9ecb10dd3926e2a821c86e2c44251bdfd4fc6e14fb65 |
| hovercard-subject-tag | issue:1701288868 |
| 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/50215/issue_layout |
| twitter:image | https://opengraph.githubassets.com/740448d8cf1ff28a11c4c858679845810c25ba59ff9cc3e7bb7eafdd2fe6b40b/angular/angular/issues/50215 |
| twitter:card | summary_large_image |
| og:image | https://opengraph.githubassets.com/740448d8cf1ff28a11c4c858679845810c25ba59ff9cc3e7bb7eafdd2fe6b40b/angular/angular/issues/50215 |
| og:image:alt | Which @angular/* package(s) are the source of the bug? compiler Is this a regression? No Description With the default value of View.encapsulation, nested selectors in sass parent selector & like be... |
| og:image:width | 1200 |
| og:image:height | 600 |
| og:site_name | GitHub |
| og:type | object |
| og:author:username | koji-nakamura-classi |
| hostname | github.com |
| expected-hostname | github.com |
| None | 27088b6977484d0d3321d9a11c907c6d6637b315cfa359ef7952dbf6292f9b14 |
| 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 | 624179fb8b88d26ba5bba08894eb60a1c5a1d93d |
| ui-target | full |
| theme-color | #1e2327 |
| color-scheme | light dark |
| react-app-name | issues |
Links:
Viewport: width=device-width