2017-02-06 40 views
0

我想提供使用角材2的主题功能。任何人都可以提供一个示例如何做到这一点?我尝试使用材质2主题,但没有奏效。角2应用程序的主题

+0

你可以定义自己的主题,只要按照材料2的主题GUID2 https://github.com/angular/material2/blob/:与其

@import '[email protected]/material/core/theming/all-theme'; 

尝试了这一点主/引导件/ theming.md –

回答

1

您可能需要箱子自定义主题theme.scss

@import '[email protected]/material/core/theming/all-theme'; 

@include md-core(); 

$primary: md-palette($md-indigo); 
$accent: md-palette($md-pink, A200, A100, A400); 
$warn: md-palette($md-red); 

$app-theme: md-light-theme($primary, $accent, $warn); 

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

把它放在你assets文件夹

然后在styles.scss刚刚导入:

@import '/assets/theme'; 

你也可以选择任何现有主题如果你只是通过参考来寻找node_modules\@angular\material\core\theming\prebuilt\例如:

@import '[email protected]/material/core/theming/prebuilt/deeppurple-amber'; 

详情请参阅docsaterial2-app