我尝试建立自己的主题。我将颜色主题更改为我的风格。但是在编译自己的主题时出现错误,这是我创建的主题。
// 1. core variables and mixins
@import "../bootstrap/functions";
@import "../bootstrap/variables";
@import "../bootstrap/mixins";
// 2. custom core variables
// colors
$theme-colors : (
"primary": "46B078",
"secondary": "#B7E1CB",
"success": "#26de81",
"info": "#2bcbba",
"warning": "#fed330",
"danger": "#fc5c65",
);
// 3. core CSS
@import "../bootstrap/root";
@import "../bootstrap/reboot";
@import "../bootstrap/type";
@import "../bootstrap/images";
@import "../bootstrap/code";
@import "../bootstrap/grid";
@import "../bootstrap/tables";
@import "../bootstrap/forms";
@import "../bootstrap/buttons";
@import "../bootstrap/transitions";
@import "../bootstrap/dropdown";
@import "../bootstrap/button-group";
@import "../bootstrap/input-group";
@import "../bootstrap/custom-forms";
@import "../bootstrap/nav";
@import "../bootstrap/navbar";
@import "../bootstrap/card";
@import "../bootstrap/breadcrumb";
@import "../bootstrap/pagination";
@import "../bootstrap/badge";
@import "../bootstrap/jumbotron";
@import "../bootstrap/alert";
@import "../bootstrap/progress";
@import "../bootstrap/media";
@import "../bootstrap/list-group";
@import "../bootstrap/close";
@import "../bootstrap/modal";
@import "../bootstrap/tooltip";
@import "../bootstrap/popover";
@import "../bootstrap/carousel";
@import "../bootstrap/utilities";
@import "../bootstrap/print";
关于吞咽的错误消息:
Error in plugin "sass"
Message:
src/sass/bootstrap/_functions.scss
Error: argument `$color-2` of `mix($color-1, $color-2, $weight: 50%)` must be a color
on line 85 of src/sass/bootstrap/_functions.scss, in function `mix`
from line 85 of src/sass/bootstrap/_functions.scss, in function `theme-color-level`
from line 103 of src/sass/bootstrap/_tables.scss
from line 25 of src/sass/themes/default.scss
>> @return mix($color-base, $color, $level * $theme-color-interval);
----------^
如何解决此错误,我的代码有什么问题。我遵循了引导文档中的说明,但仍然出错。
答案 0 :(得分:0)
primary
中的颜色theme-colors
在颜色值之前缺少#
符号。
正确的行应如下所示:
"primary": "#46B078",