Warning: file_get_contents(/data/phpspider/zhask/data//catemap/6/asp.net-mvc-3/4.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181

Warning: file_get_contents(/data/phpspider/zhask/data//catemap/7/wcf/4.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
Sass 如何使用@use引用引导scss变量?_Sass_Bootstrap 5 - Fatal编程技术网

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