Skip to content

Cannot use quasar css variables in a imported file by viteConf's additionalData #13645

Discussion options

You must be logged in to vote

I found the reason myself.

The plugin that quasar adds to the vite config adds the following import code before the additionalData is prepended.

@import 'src/css/quasar.variables.scss';
@import 'quasar/src/css/variables.sass';

So, the resulting scss code becomes as follows:

@import 'css/_Common.scss';
@import 'src/css/quasar.variables.scss';
@import 'quasar/src/css/variables.sass';

But the correct import order should be as follows:

@import 'src/css/quasar.variables.scss';
@import 'quasar/src/css/variables.sass';
@import 'css/_Common.scss';

So, you must implement a function that insert the import line to the correct location for additionalData config, rather than just supply a string.

Replies: 1 comment

Comment options

You must be logged in to vote
0 replies
Answer selected by zeodtr
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
1 participant