gpt4 book ai didi

javascript - Sass错误: Undefined variable: "$main-background-color"

转载 作者:行者123 更新时间:2023-12-02 21:41:38 25 4
gpt4 key购买 nike

我尝试在 LoginPage 组件样式期间使用 CSS 变量,但收到以下错误:SassError: undefined variable :“$main-background-color”。此错误出现在 _styles.scss 文件中。

这是我的元素结构:

project structure

我将 _variables.scssstyles.scss 导入到主 index.scss 文件中:

index.scss

导入变量时我做错了什么?为什么我无法在 _styles.scss 文件中使用它们?

最佳答案

我相信如果您想在那里使用它们,您需要将_variables.scss直接导入_styles.scss

关于javascript - Sass错误: Undefined variable: "$main-background-color",我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/60354556/

25 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com