css - Sass 不导入 Angular Material 复选框主题

标签 css angular sass angular-material

问题是,当我在 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

最佳答案

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

关于css - Sass 不导入 Angular Material 复选框主题,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/57198264/

相关文章:

css - 不向右移动

javascript - 更改类时淡入淡出的流畅过渡

html - 覆盖 jquery 移动主体背景颜色

html - Material 设计精简版 : How to display Table on Mobile?

angular - angular2 中 md-checkbox 的状态

另一个服务中的 Angular2 注入(inject)服务创建 2 个实例

javascript - (深色模式)添加 "dark-theme"后如何改变背景?

Angular 6 迁移 -.angular-cli.json 到 angular.json

具有透明中间的 CSS 径向/圆形进度指示器

css - 使用 SCSS 对齐输入和两个按钮