【问题标题】:Sass doesn't import angular material checkbox themeSass 不导入角度材质复选框主题
【发布时间】:2019-07-25 21:39:39
【问题描述】:

问题是,当我在 SCSS 文件中指定导入并定义我的自定义主题时,除了排版的样式外,我看不到复选框的样式。

我的 SCSS 文件

@import "~bootstrap/scss/bootstrap-reboot";
@import "~bootstrap/scss/bootstrap-grid";
@import "https://fonts.googleapis.com/icon?family=Material+Icons";
@import '~@angular/material/theming';

@include mat-core();

$app-primary: mat-palette($mat-cyan, 600);
$app-accent: mat-palette($mat-indigo, 900);
$app-warn: mat-palette($mat-red);
$app-theme: mat-light-theme($app-primary, $app-accent, $app-warn);

@include mat-checkbox-theme($app-theme);

将样式附加到我的页面后,我没有实际的复选框,只看到它的标签。控制台中没有错误或警告。

我也尝试放置@include angular-material-theme($app-theme);,但这也没有任何作用。


最终,Angular Material 将复选框样式保留在组件内,而不是在 SCSS 中导出

【问题讨论】:

    标签: css angular sass angular-material


    【解决方案1】:

    尝试在 angular-material-theme 之后包含您的 mat-core();

    【讨论】:

      猜你喜欢
      • 2021-08-22
      • 2018-09-15
      • 2021-03-16
      • 2019-02-12
      • 2018-08-18
      • 2022-11-28
      • 2016-01-19
      • 2018-05-12
      • 1970-01-01
      相关资源
      最近更新 更多