gpt4 book ai didi

angular - 将 Angular Material 2 主题设置为深色主题

转载 作者:行者123 更新时间:2023-12-01 07:52:45 24 4
gpt4 key购买 nike

我最近通过关注此 guide 创建了一个 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);

附言 https://github.com/jelbourn/material2-app/blob/master/src/material2-app-theme.scss

关于angular - 将 Angular Material 2 主题设置为深色主题,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/41684093/

24 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com