René's URL Explorer Experiment


Title: CSS styles not applied if using attribute HostBinding and styling a DIV with the direct child selector in a production build · Issue #49100 · angular/angular · GitHub

Open Graph Title: CSS styles not applied if using attribute HostBinding and styling a DIV with the direct child selector in a production build · Issue #49100 · angular/angular

X Title: CSS styles not applied if using attribute HostBinding and styling a DIV with the direct child selector in a production build · Issue #49100 · angular/angular

Description: Which @angular/* package(s) are the source of the bug? Don't known / other Is this a regression? Yes Description If using attribute HostBinding and styling a DIV element with the direct child selector, the styles are not applied. This ha...

Open Graph Description: Which @angular/* package(s) are the source of the bug? Don't known / other Is this a regression? Yes Description If using attribute HostBinding and styling a DIV element with the direct child selec...

X Description: Which @angular/* package(s) are the source of the bug? Don't known / other Is this a regression? Yes Description If using attribute HostBinding and styling a DIV element with the direct child s...

Opengraph URL: https://github.com/angular/angular/issues/49100

X: @github

direct link

Domain: github.com


Hey, it has json ld scripts:
{"@context":"https://schema.org","@type":"DiscussionForumPosting","headline":"CSS styles not applied if using attribute HostBinding and styling a DIV with the direct child selector in a production build","articleBody":"### Which @angular/* package(s) are the source of the bug?\r\n\r\nDon't known / other\r\n\r\n### Is this a regression?\r\n\r\nYes\r\n\r\n### Description\r\n\r\nIf using attribute HostBinding and styling a DIV element with the direct child selector, the styles are not applied.\r\n**This happens only in a producton build.**\r\n\r\nReproduction:\r\n**app.component.html**\r\n```html\r\n\u003cdiv class=\"example-1\">\r\n  Example 1 (css: > div)\r\n\u003c/div>\r\n\u003cdiv class=\"example-2\">\r\n  Example 2 (css: div)\r\n\u003c/div>\r\n\u003csection class=\"example-3\">\r\n  Example 3 (css: > section)\r\n\u003c/section>\r\n\u003csection class=\"example-4\">\r\n  Example 4 (css: section)\r\n\u003c/section>\r\n```\r\n**app.component.ts**\r\n```ts\r\nimport {Component, HostBinding} from '@angular/core';\r\n\r\n@Component({\r\n  selector: 'app-root',\r\n  templateUrl: './app.component.html',\r\n  styleUrls: ['./app.component.scss'],\r\n})\r\nexport class AppComponent {\r\n\r\n  @HostBinding('attr.data-foo')\r\n  public foo = 'bar';\r\n}\r\n\r\n```\r\n**app.component.scss**\r\n```scss\r\n:host {\r\n  &[data-foo=\"bar\"] {\r\n    > div.example-1 {\r\n      background-color: cyan; // not working\r\n    }\r\n\r\n    div.example-2 {\r\n      background-color: yellow; // working\r\n    }\r\n\r\n    > section.example-3 {\r\n      background-color: red; // working\r\n    }\r\n\r\n    section.example-4 {\r\n      background-color: green; // working\r\n    }\r\n  }\r\n}\r\n\r\n```\r\n![image](https://user-images.githubusercontent.com/25194435/219303791-d5c2f267-f9c7-4809-a0ff-d3cd9e850870.png)\r\n\r\nIn the transpiled CSS we noticed various issues:\r\n\r\nExample 1:\r\n\r\n- \"nghost\" attribute is missing after the attribute selector _[data-foo=bar]_\r\n- \"nghost\" attribute after _div.example-1_ should instead be \"ngcontent\"\r\n\r\nExample 2:\r\n\r\n- \"ngcontent\" attribute is missing after _div.example-2_. **IMPORTANT! This is not the cause of this problem, but causes the styles to leak into child components. Please let me know if I should file a separate issue for this case.**\r\n\r\n![transpiled css](https://user-images.githubusercontent.com/25194435/219305802-0dfe5085-c5a3-4268-b243-45913c72bc85.png)\r\n\r\n\r\n### Please provide a link to a minimal reproduction of the bug\r\n\r\nhttps://github.com/Marcarrian/angular-15-attribute-host-binding-issue\r\n\r\n### Please provide the exception or error you saw\r\n\r\n_No response_\r\n\r\n### Please provide the environment you discovered this bug in (run `ng version`)\r\n\r\n```true\r\nAngular CLI: 15.1.5        \r\nNode: 16.16.0              \r\nPackage Manager: npm 8.11.0\r\nOS: win32 x64              \r\n                           \r\nAngular: 15.1.4            \r\n... animations, common, compiler, compiler-cli, core, forms\r\n... platform-browser, platform-browser-dynamic, router\r\n\r\nPackage                         Version\r\n---------------------------------------------------------\r\n@angular-devkit/architect       0.1501.5\r\n@angular-devkit/build-angular   15.1.5\r\n@angular-devkit/core            15.1.5\r\n@angular-devkit/schematics      15.1.5\r\n@angular/cli                    15.1.5\r\n@schematics/angular             15.1.5\r\nrxjs                            7.8.0\r\ntypescript                      4.9.5\r\n```\r\n\r\n\r\n### Anything else?\r\n\r\n_No response_","author":{"url":"https://github.com/Marcarrian","@type":"Person","name":"Marcarrian"},"datePublished":"2023-02-16T08:35:20Z","url":"https://github.com/angular/angular/issues/49100"}

react-profiling0
react-import-mapreact,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-controllervoltron_issues_fragments
route-actionissue_layout
fetch-noncev2:cdec2960-0153-ef7f-38ac-84ba8d10ba4f
current-catalog-service-hash81bb79d38c15960b92d99bca9288a9108c7a47b18f2423d0f6438c5b7bcd2114
request-idC9FA:3D4705:886D84:B17D99:6B00DAEE
html-safe-nonceee471da99d98d8e78f0f13ed34c2cfc66ed1c63a11ecb8b29f50ca5739c6ef24
visitor-payloadeyJyZWZlcnJlciI6IiIsInJlcXVlc3RfaWQiOiJDOUZBOjNENDcwNTo4ODZEODQ6QjE3RDk5OjZCMDBEQUVFIiwidmlzaXRvcl9pZCI6IjgxNTE4NzkyMDk4NTAwMzQ5MjYiLCJyZWdpb25fZWRnZSI6ImlhZCIsInJlZ2lvbl9yZW5kZXIiOiJpYWQifQ==
visitor-hmac217e3e268f8c5982e1eb82437ed52c892083baeb68bcbc8bbab2eaaa2abf968a
hovercard-subject-tagissue:1587257274
github-keyboard-shortcutsrepository,issues,copilot
google-site-verificationApib7-x98H0j5cPqHWwSMm6dNU4GmODRoqxLiDzdx9I
octolytics-urlhttps://collector.github.com/github/collect
analytics-location///voltron/issues_fragments/issue_layout
fb:app_id1401488693436528
apple-itunes-appapp-id=1477376905, app-argument=https://github.com/_view_fragments/issues/show/angular/angular/49100/issue_layout
twitter:imagehttps://opengraph.githubassets.com/80df998899181353780dbb4902bad95672deaa04aeb2b1879e7b9b91b452040c/angular/angular/issues/49100
twitter:cardsummary_large_image
og:imagehttps://opengraph.githubassets.com/80df998899181353780dbb4902bad95672deaa04aeb2b1879e7b9b91b452040c/angular/angular/issues/49100
og:image:altWhich @angular/* package(s) are the source of the bug? Don't known / other Is this a regression? Yes Description If using attribute HostBinding and styling a DIV element with the direct child selec...
og:image:width1200
og:image:height600
og:site_nameGitHub
og:typeobject
og:author:usernameMarcarrian
hostnamegithub.com
expected-hostnamegithub.com
Nonea481f62a1e04c9b9bdcb5628230682c66d59006f5b13b080f79cba84a176905b
turbo-cache-controlno-preview
go-importgithub.com/angular/angular git https://github.com/angular/angular.git
octolytics-dimension-user_id139426
octolytics-dimension-user_loginangular
octolytics-dimension-repository_id24195339
octolytics-dimension-repository_nwoangular/angular
octolytics-dimension-repository_publictrue
octolytics-dimension-repository_is_forkfalse
octolytics-dimension-repository_network_root_id24195339
octolytics-dimension-repository_network_root_nwoangular/angular
turbo-body-classeslogged-out env-production page-responsive
disable-turbofalse
browser-stats-urlhttps://api.github.com/_private/browser/stats
browser-errors-urlhttps://api.github.com/_private/browser/errors
release84c8c5cc25e2fb7f2308428458538436baecc6d2
ui-targetfull
theme-color#1e2327
color-schemelight dark
react-app-nameissues

Links:

Skip to contenthttps://github.com/angular/angular/issues/49100#start-of-content
https://github.com/
Sign inhttps://github.com/login?return_to=https%3A%2F%2Fgithub.com%2Fangular%2Fangular%2Fissues%2F49100
GitHubRepository hosting, code review, and collaborationhttps://github.com/platform
CopilotAI coding agent for tasks, projects, and automated workhttps://github.com/features/copilot
ActionsCI/CD and automationhttps://github.com/features/actions
Code QualityQuality analysis, fixes, and enforcementhttps://github.com/features/code-quality
CodespacesCloud development environmentshttps://github.com/features/codespaces
Code SecurityVulnerability detection and remediationhttps://github.com/security/advanced-security/code-security
Secret ProtectionSecret scanning and leak preventionhttps://github.com/security/advanced-security/secret-protection
All Featureshttps://github.com/features
Documentationhttps://docs.github.com/en
Traininghttps://learn.github.com/skills
Certificationshttps://learn.github.com/credentials
Build with Copilothttps://github.com/features/ai
Customize Copilothttps://docs.github.com/en/copilot/how-tos/copilot-on-github/customize-copilot/customize-copilot-overview
Integrationshttps://github.com/marketplace
Trending reposhttps://github.com/trending
GitHub Sponsorshttps://github.com/open-source/sponsors
Developer articleshttps://github.com/resources/articles
ChangelogYour source for the latest features, improvements, and fixes across GitHub products, all in one place.https://github.blog/changelog/
Enterpriseshttps://github.com/enterprise
Teamhttps://github.com/team
Startupshttps://github.com/enterprise/startups
Nonprofitshttps://github.com/solutions/industry/nonprofits
Healthcarehttps://github.com/solutions/industry/healthcare
Financial serviceshttps://github.com/solutions/industry/financial-services
Manufacturinghttps://github.com/solutions/industry/manufacturing
Governmenthttps://github.com/solutions/industry/government
See all industrieshttps://github.com/solutions/industry
Why GitHubhttps://github.com/why-github
Customer Storieshttps://github.com/customer-stories
Business insightshttps://github.com/solutions/executive-insights
Trust Centerhttps://github.com/trust-center
GitHub Advanced SecurityEnterprise-grade code securityhttps://github.com/security/advanced-security
Copilot for businessEnterprise-grade AI featureshttps://github.com/features/copilot/copilot-business
Premium SupportEnterprise-grade 24/7 supporthttps://github.com/enterprise/premium-support
Documentationhttps://docs.github.com/en
Resource centerhttps://github.com/resources
Bloghttps://github.blog/
Events & webinarshttps://github.com/resources/events
Community Forumhttps://github.com/orgs/community/discussions
Customer Storieshttps://github.com/customer-stories
Integrationshttps://github.com/marketplace
Customer supporthttps://help.github.com/
Traininghttps://learn.github.com/skills
GitHub Statushttps://www.githubstatus.com/
Abouthttps://github.com/about
Partnershttps://github.com/partners
Changeloghttps://github.blog/changelog/
GitHub UniverseThe event for developers, by developers — talks, workshops, and what’s next for GitHub.https://githubuniverse.com/
Pricinghttps://github.com/pricing
Sign inhttps://github.com/login?return_to=https%3A%2F%2Fgithub.com%2Fangular%2Fangular%2Fissues%2F49100
Sign uphttps://github.com/signup?ref_cta=Sign+up&ref_loc=header+logged+out&ref_page=%2F%3Cuser-name%3E%2F%3Crepo-name%3E%2Fvoltron%2Fissues_fragments%2Fissue_layout&source=header-repo&source_repo=angular%2Fangular
Reloadhttps://github.com/angular/angular/issues/49100
Reloadhttps://github.com/angular/angular/issues/49100
Reloadhttps://github.com/angular/angular/issues/49100
angularhttps://github.com/angular
angularhttps://github.com/angular/angular
Codehttps://github.com/angular/angular
Issues835 (835)https://github.com/angular/angular/issues
Pull requests139 (139)https://github.com/angular/angular/pulls
Discussionshttps://github.com/angular/angular/discussions
Actionshttps://github.com/angular/angular/actions
Projectshttps://github.com/angular/angular/projects
Security and quality40 (40)https://github.com/angular/angular/security
Insightshttps://github.com/angular/angular/insights
https://github.com/angular/angular
New issuehttps://github.com/login?return_to=https://github.com/angular/angular/issues/49100
New issuehttps://github.com/login?return_to=https://github.com/angular/angular/issues/49100
CSS styles not applied if using attribute HostBinding and styling a DIV with the direct child selector in a production buildhttps://github.com/angular/angular/issues/49100#top
area: compilerIssues related to `ngc`, Angular's template compilerhttps://github.com/angular/angular/issues?q=state%3Aopen%20label%3A%22area%3A%20compiler%22
regressionIndicates than the issue relates to something that worked in a previous versionhttps://github.com/angular/angular/issues?q=state%3Aopen%20label%3A%22regression%22
needsTriagehttps://github.com/angular/angular/milestone/83
https://github.com/Marcarrian
Marcarrianhttps://github.com/Marcarrian
on Feb 16, 2023https://github.com/angular/angular/issues/49100#issue-1587257274
https://user-images.githubusercontent.com/25194435/219303791-d5c2f267-f9c7-4809-a0ff-d3cd9e850870.png
https://user-images.githubusercontent.com/25194435/219305802-0dfe5085-c5a3-4268-b243-45913c72bc85.png
https://github.com/Marcarrian/angular-15-attribute-host-binding-issuehttps://github.com/Marcarrian/angular-15-attribute-host-binding-issue
Marcarrianhttps://github.com/Marcarrian
on Feb 16, 2023https://github.com/angular/angular/issues/49100#event-8534550220
fix(workbench/view-tab): fix position of close button in view tabshttps://github.com/SchweizerischeBundesbahnen/scion-workbench/commit/a8bf77b38e4569bd4e01929e0c21d802832da9ae
a8bf77bhttps://github.com/SchweizerischeBundesbahnen/scion-workbench/commit/a8bf77b38e4569bd4e01929e0c21d802832da9ae
fix(workbench/view-tab): fix position of close button in view tabshttps://github.com/SchweizerischeBundesbahnen/scion-workbench/commit/570279e7f3cdbdda542fd0e0dc420b10153e5632
570279ehttps://github.com/SchweizerischeBundesbahnen/scion-workbench/commit/570279e7f3cdbdda542fd0e0dc420b10153e5632
Marcarrianhttps://github.com/Marcarrian
on Feb 16, 2023https://github.com/angular/angular/issues/49100#event-8535275537
Marcarrianhttps://github.com/Marcarrian
on Feb 16, 2023https://github.com/angular/angular/issues/49100#event-8535392964
fix(workbench/view): fix position of close button in view tabshttps://github.com/SchweizerischeBundesbahnen/scion-workbench/commit/ae45149fd834fb541f1efd5e59aeaf74546997fe
ae45149https://github.com/SchweizerischeBundesbahnen/scion-workbench/commit/ae45149fd834fb541f1efd5e59aeaf74546997fe
https://github.com/JeanMeche
JeanMechehttps://github.com/JeanMeche
on Feb 16, 2023https://github.com/angular/angular/issues/49100#issuecomment-1432896704
#48558https://github.com/angular/angular/pull/48558
danielwiehlhttps://github.com/danielwiehl
on Feb 16, 2023https://github.com/angular/angular/issues/49100#event-8535664535
fix(workbench/view): fix position of close button in view tabshttps://github.com/SchweizerischeBundesbahnen/scion-workbench/commit/fe4590fad856b853e01d3614903ee60befdc9b37
fe4590fhttps://github.com/SchweizerischeBundesbahnen/scion-workbench/commit/fe4590fad856b853e01d3614903ee60befdc9b37
https://github.com/JeanMeche
JeanMechehttps://github.com/JeanMeche
on Feb 16, 2023https://github.com/angular/angular/issues/49100#issuecomment-1433193866
@dario-piotrowiczhttps://github.com/dario-piotrowicz
https://github.com/dario-piotrowicz
dario-piotrowiczhttps://github.com/dario-piotrowicz
on Feb 16, 2023https://github.com/angular/angular/issues/49100#issuecomment-1433726127
@JeanMechehttps://github.com/JeanMeche
https://github.com/JeanMeche
JeanMechehttps://github.com/JeanMeche
on Feb 16, 2023https://github.com/angular/angular/issues/49100#issuecomment-1433880822
#49118https://github.com/angular/angular/pull/49118
https://github.com/Marcarrian
Marcarrianhttps://github.com/Marcarrian
on Feb 22, 2023https://github.com/angular/angular/issues/49100#issuecomment-1439540449
@JeanMechehttps://github.com/JeanMeche
reproduction repositoryhttps://github.com/Marcarrian/angular-15-attribute-host-binding-issue
alan-agius4https://github.com/alan-agius4
area: compilerIssues related to `ngc`, Angular's template compilerhttps://github.com/angular/angular/issues?q=state%3Aopen%20label%3A%22area%3A%20compiler%22
on Feb 22, 2023https://github.com/angular/angular/issues/49100#event-8579140619
ngbothttps://github.com/apps/ngbot
needsTriagehttps://github.com/angular/angular/milestone/83
on Feb 22, 2023https://github.com/angular/angular/issues/49100#event-8579141189
https://github.com/JeanMeche
JeanMechehttps://github.com/JeanMeche
on Feb 22, 2023https://github.com/angular/angular/issues/49100#issuecomment-1439738176
https://github.com/Marcarrian
Marcarrianhttps://github.com/Marcarrian
on Feb 22, 2023https://github.com/angular/angular/issues/49100#issuecomment-1439822378
#49157https://github.com/angular/angular/issues/49157
https://github.com/hisham
hishamhttps://github.com/hisham
on Jun 5, 2023https://github.com/angular/angular/issues/49100#issuecomment-1577240406
JeanMechehttps://github.com/JeanMeche
regressionIndicates than the issue relates to something that worked in a previous versionhttps://github.com/angular/angular/issues?q=state%3Aopen%20label%3A%22regression%22
on Jun 5, 2023https://github.com/angular/angular/issues/49100#event-9438217268
atscotthttps://github.com/atscott
on Oct 11, 2023https://github.com/angular/angular/issues/49100#event-10622529143
fix(compiler): apply style on :host attributes in prod builds. (#49118)https://github.com/angular/angular/commit/073ebfe09eccd5d01d27fcc46fc5d4465c1851ff
#49118https://github.com/angular/angular/pull/49118
https://docs.github.com/articles/closing-issues-via-commit-messages
073ebfehttps://github.com/angular/angular/commit/073ebfe09eccd5d01d27fcc46fc5d4465c1851ff
atscotthttps://github.com/atscott
completedhttps://github.com/angular/angular/issues?q=is%3Aissue%20state%3Aclosed%20archived%3Afalse%20reason%3Acompleted
0198d21https://github.com/angular/angular/commit/0198d21231565f5eeaa27a871b9bb9e950b4a869
on Oct 11, 2023https://github.com/angular/angular/issues/49100#event-10622529443
https://github.com/apps/angular-automatic-lock-bot
angular-automatic-lock-bothttps://github.com/apps/angular-automatic-lock-bot
on Nov 11, 2023https://github.com/angular/angular/issues/49100#issuecomment-1806582766
automatic conversation locking policyhttps://github.com/angular/angular/blob/8f24bc9443b3872fe095d9f7f77b308a361a13b4/docs/GITHUB_PROCESS.md#conversation-locking
angular-automatic-lock-bothttps://github.com/apps/angular-automatic-lock-bot
on Nov 11, 2023https://github.com/angular/angular/issues/49100#event-10930630751
ChellappanRajanhttps://github.com/ChellappanRajan
on Jan 23, 2024https://github.com/angular/angular/issues/49100#event-11564103438
fix(compiler): apply style on :host attributes in prod builds. (angul…https://github.com/ChellappanRajan/angular/commit/137555b41ef6be78a33814121d179631cd645bc8
angul…https://github.com/angular/angular/pull/49118
https://docs.github.com/articles/closing-issues-via-commit-messages
137555bhttps://github.com/ChellappanRajan/angular/commit/137555b41ef6be78a33814121d179631cd645bc8
AndrewKushnirhttps://github.com/AndrewKushnir
on Jan 26, 2024https://github.com/angular/angular/issues/49100#event-11611972005
fix(compiler): apply style on :host attributes in prod builds. (angul…https://github.com/wojtek1150/angular/commit/0198d21231565f5eeaa27a871b9bb9e950b4a869
angul…https://github.com/angular/angular/pull/49118
https://docs.github.com/articles/closing-issues-via-commit-messages
0198d21https://github.com/wojtek1150/angular/commit/0198d21231565f5eeaa27a871b9bb9e950b4a869
Sign up for freehttps://github.com/signup?return_to=https://github.com/angular/angular/issues/49100
Sign in to commenthttps://github.com/login?return_to=https://github.com/angular/angular/issues/49100
area: compilerIssues related to `ngc`, Angular's template compilerhttps://github.com/angular/angular/issues?q=state%3Aopen%20label%3A%22area%3A%20compiler%22
regressionIndicates than the issue relates to something that worked in a previous versionhttps://github.com/angular/angular/issues?q=state%3Aopen%20label%3A%22regression%22
needsTriageNo due datehttps://github.com/angular/angular/milestone/83
https://github.com
Termshttps://docs.github.com/site-policy/github-terms/github-terms-of-service
Privacyhttps://docs.github.com/site-policy/privacy-policies/github-privacy-statement
Securityhttps://github.com/security
Statushttps://www.githubstatus.com/
Communityhttps://github.community/
Docshttps://docs.github.com/
Contacthttps://support.github.com?tags=dotcom-footer

Viewport: width=device-width


URLs of crawlers that visited me.