问题描述
我正在尝试通过仅将所需组件从 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
使用这个版本组合有什么问题吗,或者有什么其他问题?我该如何解决?
解决方法
基本上,我的理解是新版本的 SASS
会发出警告。您可以降级您的版本以暂时停止警告,这样做也不应该破坏任何东西。
tl:dr 你应该改用 Sass: "1.32.13"
。