我已经在 Angular Material 2 中创建了我的自定义主题,现在我想使用我的自定义主题更改默认的正文背景颜色。我认为可以通过在theming.scss
文件中使用此地图对象来更改/覆盖它:
$mat-light-theme-background: (
status-bar: map_get($mat-grey, 300),
app-bar: map_get($mat-grey, 100),
background: map_get($mat-grey, 50), //To override this property
hover: rgba(black, 0.04), // TODO(kara): check style with Material Design UX
card: white,
dialog: white,
disabled-button: $black-12-opacity,
raised-button: white,
focused-button: $black-6-opacity,
selected-button: map_get($mat-grey, 300),
selected-disabled-button: map_get($mat-grey, 400),
disabled-button-toggle: map_get($mat-grey, 200),
unselected-chip: map_get($mat-grey, 300),
disabled-list-option: map_get($mat-grey, 200),
);
但是如何background
从我的自定义主题中更改此属性?这是我的自定义主题文件中的内容:
@import '~@angular/material/theming';
$typography: mat-typography-config( $font-family: 'Roboto, sans-serif', $body-1: mat-typography-level(13px, 18px, 400) );
@include mat-core($typography);
$primary: mat-palette($mat-indigo);
$accent: mat-palette($mat-pink, A200, A100, A400);
$warn: mat-palette($mat-red);
$theme: mat-light-theme($primary, $accent, $warn);
@include angular-material-theme($theme);