Combination of multiple :host-context and :host selectors don't work #41237
Labels
area: core
Issues related to the framework runtime
core: CSS encapsulation
P3
An issue that is relevant to core functions, but does not impede progress. Important, but not urgent
state: has PR
Milestone
🐞 bug report
Affected Package
12.0.0-next.4
Is this a regression?
No
Description
Version 12.0.0-next.4 of Angular brings improved support for host-context selectors. (See PR)
We are currently implementing a UI library and this fix will be very helpful for our project. However, we think that there's still an enhancement for this feature.
I installed 12.0.0-next.4 and tested the following scenario.
I tried this with inline styles and with a separate stylesheet referenced by
styleUrls
. Both didn't work. However, @petebacondarwin found a workaround.foo-component should be red and bar-component should be blue. Currently, only the first selector gets applied. Means bar is blue and foo is not affected by any styles. The generated CSS looks like this:
🔬 Minimal Reproduction
https://github.com/kreuzerk/host-selector-example
I needed to create a Stackblitz because I was unable to pull the next version of Angular into Stackblitz ;)
🌍 Your Environment
Angular Version:
12.0.0-next.4
The text was updated successfully, but these errors were encountered: