Sass不';不能正确编译变量
我开始用Sass不';不能正确编译变量,sass,Sass,我开始用boostrap编写自己的SCS。我遵循框架的层次结构,如: /* The main file and all partial files are in the same directory */ @import "variables"; @import "mixins"; @import "other-components"; 除了variables.scss中的每个变量都未编译外,其他所有变量都可以完美编译。据我所知,C
boostrap
编写自己的SCS。我遵循框架的层次结构,如:
/* The main file and all partial files are in the same directory */
@import "variables";
@import "mixins";
@import "other-components";
除了variables.scss
中的每个变量都未编译外,其他所有变量都可以完美编译。据我所知,CSS除了:root
之外没有其他变量,因此SCSS变量将直接编译为CSS中的值。但编译完成后,CSS中的变量与SCS中的变量保持相同,只是名称类似于--primary
,而不是值类似于#000
在我的帖子被抨击为重复之前,以下是我所做的:
@use
并将其用作命名空间,而不是@import
变量文件。这无助于解决问题
sass
包将.scss
编译成.css
。没有额外的图书馆感谢您的帮助 使用CSS变量时,使用#{}将sass代码插入其中。So'-变量:#{$sass var};