Override Angular Material style in Angular component

前端 未结 6 1019
日久生厌
日久生厌 2021-01-11 14:27

I am using Material 2 in my Angular component. I want to override one of the classes e.g. .mat-input-wrapper defined in

6条回答
  •  广开言路
    2021-01-11 14:41

    The preferred solution probably would be to define the styles in your own Material theming style sheet. The use of /deep/ is deprecated (Angular V 4.3): https://angular.io/guide/component-styles#special-selectors

    You can now use ::ng-deep at as an alternative to defining your own theming style sheet.

    However, using the ::ng-deep can influence the use Material icons negatively again when using it to override a default font family (as Material Icons is a font-family as well)

提交回复
热议问题