简体   繁体   English

如何从另一个 scss 文件访问我的主题颜色?

[英]How do I access my main theme colors from another scss file?

I have your standard Angular Material theme going on.我有你的标准 Angular Material 主题。 Here's my theme.scss file:这是我的 theme.scss 文件:

@import '~@angular/material/core/theming/all-theme';
@include mat-core();

$candy-app-primary: mat-palette($mat-light-blue);
$candy-app-accent:  mat-palette($mat-red, A200, A100, A400);
$candy-app-warn:    mat-palette($mat-yellow);
$candy-app-theme:   mat-light-theme($candy-app-primary, $candy-app-accent, $candy-app-warn);

@include angular-material-theme($candy-app-theme);

您必须将该sass文件导入yours.so sass编译器才能到达主题上下文

尝试background-color: map-get($candy-app-accent, A100);<\/code>

"

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

相关问题 无法从另一个文件夹访问我的.scss捆绑文件 - Unable to access my .scss bundle file from another folder 如何在Angular2的CSS中使用材质主题颜色? - How do I use a material theme colors in my css in Angular2? 如何将 boolean 变量从 Html 或 ts 文件访问到 scss? - How can I access boolean variable from Html or ts file into scss? 角度材质主题:使用另一个scss文件中的主题定义对象 - angular material theming: consume the theme definition object in another scss file 升级到2.0.0后如何从另一个系统访问Angular2 App - How do I access my Angular2 App from another system after upgrading to 2.0.0 如何将 css/scss 文件从 node_module 导入一个类(用于更改组件的主题) - How Import css/scss file into a class from node_module ( for change theme of component ) 如何在组件的动画中利用自定义主题的颜色? - How can I utilize my custom theme's colors in a component's animation? 如何在我的库中声明/包含一个导入的 scss 文件夹,以便可以在我的应用程序的 scss 文件中调用 @import 它? - How do I declare/include an imported scss folder in my library so I can call @import it in my application's scss files? Ionic 3 - 如何移动主题> variable.scss文件 - Ionic 3 - How to move the theme>variable.scss File 从 scss 中的另一个文件继承类属性 - Inherit class properties from another file in scss
 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM