-
Notifications
You must be signed in to change notification settings - Fork 26.3k
fix(platform-browser): correctly add external stylesheets to ShadowDOM components #58482
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
Conversation
I think is solving more or less the same issue as #42112 which got stuck in limbo. |
562d8e9
to
2d49cb0
Compare
A more comprehensive review of the style handling is something we should definitely consider in the future. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM, just a minor comment 👍
@crisbeto could you please also review this change when you get a chance?
…M components Angular components that use ShadowDOM view encapsulation have an alternate execution path for adding component styles to the DOM that does not use the SharedStylesHost that all other view encapsulation modes leverage. To ensure that ShadowDOM components receive all defined styles, additional logic has been added to the ShadowDOM specific renderer to also cover external styles.
2d49cb0
to
5f132c5
Compare
This PR was merged into the repository by commit c22b5ac. The changes were merged into the following branches: main, 19.0.x |
…M components (#58482) Angular components that use ShadowDOM view encapsulation have an alternate execution path for adding component styles to the DOM that does not use the SharedStylesHost that all other view encapsulation modes leverage. To ensure that ShadowDOM components receive all defined styles, additional logic has been added to the ShadowDOM specific renderer to also cover external styles. PR Close #58482
As a user who has struggled with some Shadow DOM/Style interactions in the past, I'm encouraged to see this. Could someone explain the practical implications of this change, and how one might interact with it in their Angular code? Thanks for your work! |
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. |
Angular components that use ShadowDOM view encapsulation have an alternate execution path for adding component styles to the DOM that does not use the SharedStylesHost that all other view encapsulation modes leverage. To ensure that ShadowDOM components receive all defined styles, additional logic has been added to the ShadowDOM specific renderer to also cover external styles. In the future, it may be useful to review the DOM renderers and shared styles host to potentially remove the near duplicate ShadowDOM style logic.