Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
fix(cdk/a11y): make cdk-high-contrast work w/ emulated view encapsula…
…tion (#18152) * fix(cdk/a11y): make cdk-high-contrast work w/ emulated view encapsulation Say you have this in your component: ```scss .some-element { @include cdk-high-contrast() { border: 1px solid white; } } ``` With this change, this will output: ```scss .cdk-high-contrast-active .some-element, .cdk-high-contrast-active :host .some-element { border: 1px solid white; } ``` Here, `.cdk-high-contrast-active .some-element` will apply in places where encapsulation is turned off, and `.cdk-high-contrast-active :host .some-element` will apply in cases where encapsulation is emulated. Neither will work in Shadow DOM (which we don't officially support). AFAIK, Shadow DOM would need to use `:host-content()`, which we could consider adding if we get an additional request. This adds a few more bytes, but high-contrast styles tend to be pretty limited.
- Loading branch information