css - 带有自定义调色板的 Angular Material 自定义主题

标签 css node.js angular sass angular-material

我想应用调色板:

Palette

Codepen

这是我当前的主题文件:

@import "~@angular/material/_theming";

@include mat-core();

$app-primary: mat-palette(#46828d);
$app-accent: mat-palette(#276c8a);
$app-warn: mat-palette(yellow);

$app-theme: mat-dark-theme($app-primary, $app-accent, $app-warn);

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

不知道如何使用SASS哈哈

元素:https://github.com/theADAMJR/2PG-Dashboard

最佳答案

这就是我最终使用自定义调色板(Angular 9)创建自定义主题的方式

Generate Colour Palette

@import "~@angular/material/theming";

@include mat-core();

// generated custom palette
$primary-palette: (
    50 : #e9f0f1,
    100 : #c7d9dd,
    200 : #a2c0c6,
    300 : #7da7af,
    400 : #61949d,
    500 : #45818c,
    600 : #3e7984,
    700 : #366e79,
    800 : #2e646f,
    900 : #1f515c,
    A100 : #9cecff,
    A200 : #69e3ff,
    A400 : #36d9ff,
    A700 : #1dd4ff,
    contrast: (
        50 : #000000,
        100 : #000000,
        200 : #000000,
        300 : #000000,
        400 : #000000,
        500 : #ffffff,
        600 : #ffffff,
        700 : #ffffff,
        800 : #ffffff,
        900 : #ffffff,
        A100 : #000000,
        A200 : #000000,
        A400 : #000000,
        A700 : #000000,
    )
);

$primary: mat-palette($primary-palette);
$secondary: mat-palette($mat-blue);
$warn: mat-palette($mat-yellow);

$theme: mat-dark-theme($primary, $secondary, $warn);

// apply the dark theme
@include angular-material-theme($theme);

How can I use custom theme palettes in Angular?

关于css - 带有自定义调色板的 Angular Material 自定义主题,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/61387719/

相关文章:

javascript - 使用 npm 在 macOS 上安装 webpack

css - 为什么更改不会在 Wordpress 中生效?

html - 使图像变大并使 div 在悬停时滑入

javascript - Node js 在异步行为中丢失 : undefined

node.js - 为什么我在测试中收到 401 响应?

从 http.get() 加载的 JSON 数据在我的 Angular 2 模板中未定义

javascript - 这个代码 'true <=> false'是什么意思

Angular 组件继承和继承订阅

Jquery 切换 Action

javascript - Canvas |在从 SVG 创建过程中如何设置 Canvas 元素的样式?