简体   繁体   English

Sass不导入角度材质复选框主题

[英]Sass doesn't import angular material checkbox theme

The problem is that when I specify imports in SCSS file and define my custom theme I don't see styles for checkbox except for those for typography. 问题是,当我在SCSS文件中指定导入并定义自定义主题时,除了版式的样式外,我没有看到复选框的样式。

My SCSS file 我的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);

After attaching styles to my page I don't the actual checkbox and only see its label. 将样式附加到我的页面后,我没有看到实际的复选框,仅看到其标签。 There is no error or warning in console. 控制台中没有错误或警告。

I also tried to place @include angular-material-theme($app-theme); 我还尝试放置@include angular-material-theme($app-theme); but that didn't do any work either. 但这也没有任何作用。


Ended up with that Angular Material keeps checkbox styles inside the component and not exporting it in SCSS 最后,Angular Material将复选框样式保留在组件内部,而不是将其导出到SCSS中

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

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM