Sass 如何使用@use引用引导scss变量?
我在我的站点中有一个简单的组件样式表,我试图引入Sass 如何使用@use引用引导scss变量?,sass,bootstrap-5,Sass,Bootstrap 5,我在我的站点中有一个简单的组件样式表,我试图引入$zindex fixed变量,但我的方法似乎有问题。任何帮助都将不胜感激 我的样式表如下所示: @use "~bootstrap/scss/variables"; .playerBar { position: fixed; left: 0px; bottom: 0px; height: 90px; min-width: 620px; width: 100%; z-index: variables.
$zindex fixed
变量,但我的方法似乎有问题。任何帮助都将不胜感激
我的样式表如下所示:
@use "~bootstrap/scss/variables";
.playerBar {
position: fixed;
left: 0px;
bottom: 0px;
height: 90px;
min-width: 620px;
width: 100%;
z-index: variables.$zindex-fixed;
background: #1e1e1e;
}
我得到以下错误:
SassError: Undefined mixin.
╷
307 │ @include _assert-ascending($grid-breakpoints, "$grid-breakpoints");
│ ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
╵
node_modules/bootstrap/scss/_variables.scss 307:1 @use
这是在sass 1.30.0中使用Bootstrap 5.0.0-beta1。请让我知道,如果我可以提供更多的信息来帮助诊断 在Bootstrap v5中有支持sass模块系统的功能。目前,解决方案是使用@import
而不是@use
:
@import "~bootstrap/scss/functions";
@import "~bootstrap/scss/variables";
.playerBar {
position: fixed;
left: 0px;
bottom: 0px;
height: 90px;
min-width: 620px;
width: 100%;
z-index: $zindex-fixed;
background: #1e1e1e;
}
主要是因为sass团队拒绝使用@import规则:是的,因为他们正在逐步淘汰它。你使用Dart sass吗?是的,版本1.30