【问题标题】:Angular ::ng-deep not working in global styleAngular ::ng-deep 不能以全局方式工作
【发布时间】:2020-06-10 05:39:16
【问题描述】:

我用我插入的样式创建了一个组件

::ng-deep .input-blue.mat-focused .mat-form-field-label {
  color: #6200EE !important;
}

完美运行。但是,当我将此代码添加到全局样式中以在所有不工作的组件中使用它时。

【问题讨论】:

标签: css angular angular-material


【解决方案1】:

全局 style.css 只是一个普通的、非 Angular 或至少非封装(这是它的全部要点)样式表。删除::ng-deep 然后离开

.input-blue.mat-focused .mat-form-field-label {
  color: #6200EE !important;
}

【讨论】:

    猜你喜欢
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 2016-01-26
    • 1970-01-01
    • 2019-06-22
    • 2018-07-26
    • 2018-07-06
    • 1970-01-01
    相关资源
    最近更新 更多