小编Das*_*all的帖子

SCSS变量不生效

我目前正在努力理解为什么我对系统颜色的更改没有生效。

这是我在 chrome 中看到的图像。

这是我在 chrome 中看到的图像。

但这正是我期望看到的

但这正是我期望看到的

我有三个文件variables.scss、bootstrap.scss 和branding.scss。这是我的 Angular 项目中主 styles.scss 中的导入列表。

这是我的进口清单。

@import "styles/variables";
@import "../../../node_modules/bootstrap/scss/bootstrap";
@import "styles/branding";
Run Code Online (Sandbox Code Playgroud)

我的变量的片段

/* =====================================
    General Colours
===================================== */

$color-black: rgb(0,0,0);
$color-white: rgb(255,255,255);

/* System Backgrounds
===================================== */
$color-lm-bg-primary:   #8E8E93;
$color-lm-bg-secondary: #8E8E93;
$color-lm-bg-tertiary:  #8E8E93;

/* System Greys
===================================== */
$color-lm-grey-1:   #8E8E93;
$color-lm-grey-2:   #AEAEB2;
$color-lm-grey-3:   #C7C7CC;
$color-lm-grey-4:   #D1D1D6;
$color-lm-grey-5:   #E5E5EA;
$color-lm-grey-6:   #F2F2F7;

/* System Tints
===================================== */
$color-lm-blue:     #007AFF;
$color-lm-green:    #34C759;
$color-lm-indigo:   #5856D6;
Run Code Online (Sandbox Code Playgroud)

最后这是我的branding.scss

:root {

    /* General backgrounds and colours
    ===================================== */
    --bg-primary-color:     $color-lm-bg-primary; …
Run Code Online (Sandbox Code Playgroud)

html css sass angular

2
推荐指数
1
解决办法
1470
查看次数

标签 统计

angular ×1

css ×1

html ×1

sass ×1