gpt4 book ai didi

javascript - 使用 toolbox-loader 配置 react-toolbox sass 变量

转载 作者:行者123 更新时间:2023-11-30 16:17:37 28 4
gpt4 key购买 nike

我想更改 $appbar-height 变量的默认值。

我用

创建 toolbox-theme.scss 文件
$appbar-height: 3 * $unit !default;

但是我得到了很多错误:

ERROR in ./~/css-loader?sourceMap&modules&importLoaders=1&localIdentName=[name]__[local]___[hash:base64:5]!./~/sass-loader?sourceMap!./~/toolbox-loader!./~/react-toolbox/lib/app/style.scss
Module build failed:
top: 0;
^
Undefined variable: "$unit".
in /home/jules/projects/tourbnb-frontend/node_modules/react-toolbox/lib/app/style.scss (line 3, column 21)
@ ./~/react-toolbox/lib/app/style.scss 4:14-230 13:2-17:4 14:20-236

ERROR in ./~/css-loader?sourceMap&modules&importLoaders=1&localIdentName=[name]__[local]___[hash:base64:5]!./~/sass-loader?sourceMap!./~/toolbox-loader!./src/styles/styles.scss
Module build failed:
undefined
^
Undefined variable: "$unit".
in /home/jules/projects/tourbnb-frontend/src/styles/styles.scss (line 3, column 21)
@ ./src/styles/styles.scss 4:14-261 13:2-17:4 14:20-267

ERROR in ./~/css-loader?sourceMap&modules&importLoaders=1&localIdentName=[name]__[local]___[hash:base64:5]!./~/sass-loader?sourceMap!./~/toolbox-loader!./src/components/header/style.scss
Module build failed:
@import "~react-toolbox/lib/button/config";
^
Undefined variable: "$unit".
in /home/jules/projects/tourbnb-frontend/src/components/header/style.scss (line 3, column 21)
@ ./src/components/header/style.scss 4:14-269 13:2-17:4 14:20-275

ERROR in ./~/css-loader?sourceMap&modules&importLoaders=1&localIdentName=[name]__[local]___[hash:base64:5]!./~/sass-loader?sourceMap!./~/toolbox-loader!./~/react-toolbox/lib/button/style.scss
Module build failed:
@import "./config";
^
Undefined variable: "$unit".
in /home/jules/projects/tourbnb-frontend/node_modules/react-toolbox/lib/button/style.scss (line 3, column 21)
@ ./~/react-toolbox/lib/button/style.scss 4:14-230 13:2-17:4 14:20-236

ERROR in ./~/css-loader?sourceMap&modules&importLoaders=1&localIdentName=[name]__[local]___[hash:base64:5]!./~/sass-loader?sourceMap!./~/toolbox-loader!./~/react-toolbox/lib/app_bar/style.scss
Module build failed:

^
Undefined variable: "$unit".
in /home/jules/projects/tourbnb-frontend/node_modules/react-toolbox/lib/app_bar/style.scss (line 3, column 21)
@ ./~/react-toolbox/lib/app_bar/style.scss 4:14-230 13:2-17:4 14:20-236

ERROR in ./~/css-loader?sourceMap&modules&importLoaders=1&localIdentName=[name]__[local]___[hash:base64:5]!./~/sass-loader?sourceMap!./~/toolbox-loader!./~/react-toolbox/lib/ripple/style.scss
Module build failed:

^
Undefined variable: "$unit".
in /home/jules/projects/tourbnb-frontend/node_modules/react-toolbox/lib/ripple/style.scss (line 3, column 21)
@ ./~/react-toolbox/lib/ripple/style.scss 4:14-230 13:2-17:4 14:20-236

如果我将我的配置文件更改为 $color-primary-dark: $palette-blue-700 !default; 它可以正常工作并更改颜色。 $unit$palette-blue-700 有何不同?

我的样式 webpack 加载器:

{
test: /(\.css|\.scss)$/,
loader: 'style!css?sourceMap&modules&importLoaders=1&localIdentName=[name]__[local]___[hash:base64:5]!sass?sourceMap!toolbox'
}

最佳答案

toolbox-loader 只导入 _colors.scss 文件(参见 first code line )

您必须手动导入 _globals.scss 文件(或 fork toolbox-loader)。

关于javascript - 使用 toolbox-loader 配置 react-toolbox sass 变量,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/35255862/

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