我最近按照本指南创建了一个Angular Material 2应用程序.现在我想知道如何将主题更改为黑暗或dark-theme
?
在style.css文件中添加以下CSS:
@import '~@angular/material/core/theming/all-theme'; // NOTE: Theming is currently experimental and not yet publically released! @include md-core(); $primary: md-palette($md-deep-purple); $accent: md-palette($md-amber, A200, A100, A400); $theme: md-light-theme($primary, $accent); @include angular-material-theme($theme); $dark-primary: md-palette($md-pink, 700, 500, 900); $dark-accent: md-palette($md-blue-grey, A200, A100, A400); $dark-warn: md-palette($md-deep-orange); $dark-theme: md-dark-theme($dark-primary, $dark-accent, $dark-warn); @include angular-material-theme($dark-theme);
PS https://github.com/jelbourn/material2-app/blob/master/src/material2-app-theme.scss