在我的style.sass问题中导入bootstrap变量

Gia*_*dis 4 sass twitter-bootstrap

我试图在我的style.sass中导入bootstrap 4 beta变量部分但是当我编译时我得到以下错误:

events.js:160 throw er; //未处理"错误"事件^错误:node_modules \引导\ scss_variables.scss错误:参数$colordarken($color, $amount)必须是一个彩色

   Backtrace:
    node_modules/bootstrap/scss/_variables.scss:168, in function `darken`
    node_modules/bootstrap/scss/_variables.scss:168
    on line 168 of node_modules/bootstrap/scss/_variables.scss
Run Code Online (Sandbox Code Playgroud)

$ link-hover-color:darken($ link-color,15%)!default; ------------------------ ^

at options.error (C:\Users\Giannis\Desktop\np-lab\node_modules\node-sass\lib\index.js:291:26)
Run Code Online (Sandbox Code Playgroud)

这是我的代码:

@import "../../../node_modules/bootstrap/scss/variables"

body
  background-color: red
Run Code Online (Sandbox Code Playgroud)

有什么想法发生了什么?谢谢

小智 10

在导入变量文件之前,您必须导入functions.scss.变暗功能在其中定义.

@import "../../../node_modules/bootstrap/scss/functions";
@import "../../../node_modules/bootstrap/scss/variables";
<!--your styles here-->
Run Code Online (Sandbox Code Playgroud)