Bootstrap SCSS 中的弃用警告

问题描述

我正在尝试通过仅将所需组件从 bootstrap sass 导入 style.scss 文件来创建自定义引导程序。但是,当我导入和编译 3 个必需的组件时,我收到了一系列弃用警告。

SCSS:

@import "./bootstrap-4.3.1/scss/functions";
@import "./bootstrap-4.3.1/scss/variables";
@import "./bootstrap-4.3.1/scss/mixins";

控制台警告(众多警告中的第一个):

Deprecation Warning: Using / for division is deprecated and will be removed in Dart Sass 2.0.0.

Recommendation: math.div($spacer,2)

More info and automated migrator: https://sass-lang.com/d/slash-div

    ╷
298 │ $headings-margin-bottom:      $spacer / 2 !default;
    │                               ^^^^^^^^^^^
    ╵
    bootstrap-4.3.1\scss\_variables.scss 298:31  @import
    style.scss 3:9                               root stylesheet

我正在使用以下版本的工具:

引导程序:4.3.1,Sass:1.33.0 compiled with dart2js 2.13.0

使用这个版本组合有什么问题吗,或者有什么其他问题?我该如何解决

解决方法

I found a solution here.

基本上,我的理解是新版本的 SASS 会发出警告。您可以降级您的版本以暂时停止警告,这样做也不应该破坏任何东西。

tl:dr 你应该改用 Sass: "1.32.13"

相关问答

Selenium Web驱动程序和Java。元素在(x,y)点处不可单击。其...
Python-如何使用点“。” 访问字典成员?
Java 字符串是不可变的。到底是什么意思?
Java中的“ final”关键字如何工作?(我仍然可以修改对象。...
“loop:”在Java代码中。这是什么,为什么要编译?
java.lang.ClassNotFoundException:sun.jdbc.odbc.JdbcOdbc...