Closed shaozi closed 4 years ago
use ng-deep for styling the subcomponents like
::ng-deep {
.CodeMirror {
// style here
}
}
but ::ng-deep
is deprecated: https://angular.io/guide/component-styles#deprecated-deep--and-ng-deep
::ng-deep
is marked as deprecated true, however without a viable replacement it is the de-facto way to do encapsulated dom piercing.
Remember to always do :host ::ng-deep
to ensure the style is only applied to descendants of the component, not global.
My suspicion is that Angular will replace the unsafe-if-misused ::ng-deep
with a new ::ng-host-deep
Hi,
I just installed ngx-codemirror in a Angular 9 app. I found I cannot change the style in a component level sass file. My
app.component.sass
file contains this code:But the code mirror does not have any of these styles.
If I put the same code in
styles.sass
, it works.