div{color:$red-1;background-color:$grey-5;} but it results in an undefined variable due to $red-1 .mistake. If I import the style file explicitly, I just">
I configured a Vue3 Quasar project throughvue add quasar
. I can't understand how to use quasar sass/scss variables.
From the documentation I expected to use
But due to$red-1
, it will result inundefined variable.
error. If I import the style file explicitly, I can use the variables there, such as$primary
, but not the other Quasar variables.
Should I also explicitly import all variables from Quasar sass/scss?
My project configuration is as follows:
import { createApp } from 'vue' import App from './App.vue' import './assets/main.css' import { Quasar } from 'quasar' import quasarUserOptions from './quasar-user-options' const app = createApp(App) app.use(Quasar, quasarUserOptions) app.mount('#app')
Side question: When using Quasar's css classes,bg-primary
andbg-secondary
use Quasar's defined primary and secondary colors instead of my style choices. Is this expected behavior?
Sass/SCSS variables are only available in
quasar-cli
hosted apps.https://quasar.dev/style/sass-scss-variables