I have a problem with css variables used in scss files.
When it's used as a pure value works fine, for example: iside file theme.css
:root {
--app-bg-color: #f0f0f0;
}
and inside header.scss file:
...
background: linear-gradient(0.25turn, var(--app-bg-color), rgba(var(--app-bg-color), 0.7));
...
var(--app-bg-color) works fine, but
rgba(var(--app-bg-color), 0.7) is not working properly
and I have got an error:
Error: /styles/header.scss:30:8: Unable to parse color from string "var(--app-bg-color)"
This is a part of babel.config.js:
{
test: /\.scss$/,
use: [
{
loader: MiniCssExtractPlugin.loader,
},
{
loader: 'css-loader',
options: {
modules: {
localIdentName: '[local]__[hash:base64:5]',
},
importLoaders: 1,
},
},
{
loader: 'postcss-loader',
options: {
syntax: 'postcss-scss',
plugins: getSassPlugins({ isProd: false }),
},
},
],
},
I can't find, why it's not working; Do You have any ideas?