是否可以使用mixins设置材质2占位符字体大小?

时间:2017-11-15 11:23:29

标签: angular placeholder mixins angular-material2

我在Angular 4项目中使用material2。 我想使用mixin为我的项目中的输入和md-select global设置占位符和文本大小。

我正在使用下面的代码在md-select中设置font-size并且它按预期工作..但是当我尝试使用相同的方式设置$ input占位符时它根本不会影响...

有人知道怎么做吗?

@import '~@angular/material/theming';

$custom-typography: mat-typography-config(
  $subheading-2:  mat-typography-level(14px, 1.125, 400)
);

@include mat-core($custom-typography);

我找到了一个临时解决方案,在我的CSS中设置这个样式全局,但我认为这不是道具方式......

.mat-form-field-placeholder {
  font-size: 14px !important;
  line-height: 28px !important;
}
.mat-input-element {
  font-size:14px !important;
}

0 个答案:

没有答案
相关问题