Warning: file_get_contents(/data/phpspider/zhask/data//catemap/1/database/8.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
Css 修改mixin中的引导变量_Css_Sass_Bootstrap 4_Scss Mixins - Fatal编程技术网

Css 修改mixin中的引导变量

Css 修改mixin中的引导变量,css,sass,bootstrap-4,scss-mixins,Css,Sass,Bootstrap 4,Scss Mixins,使用Bootstrap 4,我尝试在mixin中更改brand primary的值: // variables $theme-colors: ( "main": #9fa28b, "another-section": #ec008c, "yet-another-section": #00b0d8 ); // main scss @mixin theme($color){ $theme-colors: ( "brand-primary": $color

使用Bootstrap 4,我尝试在mixin中更改
brand primary
的值:

// variables
$theme-colors: (
  "main": #9fa28b,
  "another-section": #ec008c,
  "yet-another-section": #00b0d8
);

// main scss
@mixin theme($color){
    $theme-colors: (
        "brand-primary": $color
    );
}

body {
    @include theme(theme-color($key: "main"));

    &.another-section {
        @include theme(theme-color($key: "another-section"));
    }

    &.yet-another-section {
        @include theme(theme-color($key: "yet-another-section"));
    }
}
它编译时没有错误,但是编译后的css中没有类
另一节
另一节


有没有办法在mixin(或任何变量)中覆盖
品牌主色
。您所要做的就是覆盖原色检查此链接

在此处查看:


使用map.get($theme colors,“warning”);相反

您正在尝试修改哪个版本的引导?引导程序4中没有
品牌主
变量?它只是初级的?