我能够得到小学,口音和警告调色板,并将它们保存在SCSS瓦尔:是否可以检索Angular 4 Material Theme的背景和前景调色板?
$candy-app-theme: mat-dark-theme($candy-app-primary, $candy-app-accent, $candy-app-warn);
$primary: map-get($candy-app-theme, primary);
$accent: map-get($candy-app-theme, accent);
$warn: map-get($candy-app-theme, warn);
现在我能我的风格与CSS类自己的组件。但可以说我想制作一个卡片css类(无法想象一个更好的例子,我知道有一个卡片组件),背景色比md-sidenav-container的正常背景稍浅。
我会如何处理这个问题?
我已经看了@Theming your own components(可惜它没有覆盖) 另外我偶然发现了this guide。
我想这一点 - 但只要我试图让一个出彩的前景我得到了以下错误:
color: mat-color($foreground, text);
//Error
Module build failed:
undefined
^
Argument `$map` of `map-get($map, $key)` must be a map
Backtrace:
node_modules/@angular/material/_theming.scss:1107, in function `map-get`
node_modules/@angular/material/_theming.scss:1107, in function `mat-color`
src/assets/scss/angular-material/main-theme.scss:22
in C:\Users\tobia\Documents\frontend\node_modules\@angular\material\_theming.scss (line 1107, column 11)
Error:
undefined
^
Argument `$map` of `map-get($map, $key)` must be a map
Backtrace:
node_modules/@angular/material/_theming.scss:1107, in function `map-get`
node_modules/@angular/material/_theming.scss:1107, in function `mat-color`
我希望我没有忽视了一些东西明显。任何形式的帮助,将不胜感激:)
谢谢指导帮助我 - 包括ml文件树主题($主题);不是解决方案,我只是有一些搞砸了 –