Css 即使变量已更改,Sass也会输出默认文件

Css 即使变量已更改,Sass也会输出默认文件,css,twitter-bootstrap,command-line,sass,bootstrap-4,Css,Twitter Bootstrap,Command Line,Sass,Bootstrap 4,我正在尝试为我的自定义版本的引导更改一些变量。现在我有引导SCSS文件和我自己的变量文件。我的文件如下所示: @import "/path/to/bootstrap"; $blue: #42a5f5; $indigo: #5c6bc0; more styles here… :root { --blue: #007bff; --indigo: #6610f2; more styles here… 但是,当我运行sass/path/to/custom.scss/path/to/o

我正在尝试为我的自定义版本的引导更改一些变量。现在我有引导SCSS文件和我自己的变量文件。我的文件如下所示:

@import "/path/to/bootstrap";
$blue:    #42a5f5;
$indigo:  #5c6bc0;
more styles here…
:root {
  --blue: #007bff;
  --indigo: #6610f2;
more styles here…
但是,当我运行sass/path/to/custom.scss/path/to/output.css时,它仍然输出默认引导文件,如下所示:

@import "/path/to/bootstrap";
$blue:    #42a5f5;
$indigo:  #5c6bc0;
more styles here…
:root {
  --blue: #007bff;
  --indigo: #6610f2;
more styles here…
为什么会发生这种情况?

根据:

同一Sass文件中的变量重写可以位于默认变量之前或之后。但是,在跨Sass文件重写时,必须在导入引导的Sass文件之前进行重写

由于您创建了自己的custom.scss文件,因此它应该如下所示:

// Your variable overrides
$blue:    #42a5f5;
$indigo:  #5c6bc0;

// Bootstrap and its default variables
@import "/path/to/bootstrap";