Does not work scss variables when I change the directory path css in quasar.config.js
See original GitHub issueWhat happened?
quasar.variables.scss(src/app/styles):
$app-bg-color: #f2f8ff;
Global variable in component:
<template>
<div class="c"></div>
</template>
<style lang="scss">
.c {
background: $app-bg-color;
}
</style>
But, I have error:
Syntax Error: SassError: Undefined variable.
It only works if you import a file with variables wherever variables are used.
Quasar config:
{
css: [
'../app/styles/app.scss',
'../app/styles/width.scss',
],
}
// or
{
css: [
'../app/css/app.scss',
'../app/css/width.scss',
],
}
What did you expect to happen?
I use variables as before
Reproduction URL
https://stackblitz.com/edit/quasarframework-webpack-nvwe18?file=src/app/css/quasar.variables.scss
How to reproduce?
Follow the link above
Flavour
Quasar CLI with Webpack (@quasar/cli | @quasar/app-webpack)
Areas
Quasar CLI Commands/Configuration (@quasar/cli | @quasar/app-webpack | @quasar/app-vite)
Platforms/Browsers
Chrome
Quasar info output
No response
Relevant log output
No response
Additional context
No response
Issue Analytics
- State:
- Created a year ago
- Comments:5 (2 by maintainers)
Top Results From Across the Web
Sass/SCSS Variables - Quasar Framework
Quasar CLI detects if the file contains at least one '$' character, and if so, it automatically imports the Quasar Sass/SCSS variables. ......
Read more >Quasar variables are undefined if use @use instead ... - GitHub
Is there any way to include them with @use and access quasar variables or do we have to use @import?
Read more >Storybook Global Scss variables - Stack Overflow
For me, creating a webpack.config.js file in the .storybook folder with the below configuration solved my problem: module.exports = (storybookBaseConfig ...
Read more >Public Path - webpack
The publicPath configuration option can be quite useful in a variety of ... To approach this problem you can easily use a good...
Read more >global css cannot be imported from files other than your ...
js CSS loader (see here) instead of legacy @zeit/next-sass . Replace @zeit/next-sass package with sass . Remove next.config.js . Or do not ......
Read more >Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start FreeTop Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
Top GitHub Comments
Hi,
quasar.variables.scss needs to be in its original place (src/css) otherwise it’s like you’re not using this feature.
Can I add a parameter to the configuration?
https://github.com/quasarframework/quasar/blob/dev/app-webpack/lib/webpack/create-chain.js
Add in
cfg.build.sassLoaderOptions
andcfg.build.scssLoaderOptions
new property -CSS_VARIABLES_PATH
from quasar.config.js.Then we could throw them in https://github.com/quasarframework/quasar/blob/dev/app-webpack/lib/helpers/css-variables.js through https://github.com/quasarframework/quasar/blob/dev/app-webpack/lib/webpack/inject.style-rules.js.
This is an example. If you think about it, it can be done more elegantly.