【发布时间】:2018-06-11 09:46:15
【问题描述】:
我有一个 Angular6 应用程序,它使用 CLI 和 material2 以及自定义主题。现在对于另一个客户,我想使用相同的应用程序,但颜色不同。我怎样才能做到这一点?我不想维护第二个代码库,所以它必须与我认为的构建和/或环境有关?
我在styles.scss中导入的主题:
@import '~@angular/material/theming';
// Plus imports for other components in your app.
// Include the common styles for Angular Material. We include this here
so that you only
// have to load a single css file for Angular Material in your app.
// Be sure that you only ever include this mixin once!
@include mat-core();
// Define the palettes for your theme using the Material Design
palettes available in palette.scss
// (imported above). For each palette, you can optionally specify a
default, lighter, and darker
// hue.
$app-primary: mat-palette($mat-blue, 500);
$app-accent: mat-palette($mat-blue, 900);
// The warn palette is optional (defaults to red).
$app-warn: mat-palette($mat-red);
// Create the theme object (a Sass map containing all of the palettes).
$app-theme: mat-light-theme($app-primary, $app-accent, $app-warn);
// Include theme styles for core and each component used in your app.
// Alternatively, you can import and @include the theme mixins for each
component
// that you are using.
@include angular-material-theme($app-theme);
【问题讨论】:
标签: angular angular-cli angular-material2 angular6 angular-cli-v6