vuetify-loader: Unable to access Vuetify Sass module configuration
(as discussed with Kael on Discord)
https://github.com/glen-84/vuetify-loader-issue
If you try to forward the configured Vuetify Sass module with something like:
main.scss
@forward "vuetify/styles" with
(
$body-font-family: "monospace"
);
app.vue
<style lang="scss" scoped>
@use "./main" as x;
a {
font-family: x.$body-font-family;
}
</style>
You see two different types of errors:
modulesTypeError: options.awaitResolve is not a functionSassError: This variable was not declared with !default in the @used module.

@KaelWD What is the best way forward here? (excuse the pun)
If this is not possible, should developers manually import the Sass files?
About this issue
- Original URL
- State: closed
- Created 3 years ago
- Comments: 31 (8 by maintainers)
Links to this issue
Commits related to this issue
- feat: add styles.configFile option closes #263 closes #245 closes #221 — committed to vuetifyjs/vuetify-loader by KaelWD 2 years ago
This is now officially supported and I’ve updated the documentation: https://next.vuetifyjs.com/en/features/sass-variables/
This seems to work for me:
Or if having it split between general and component variables is too confusing:
If you use pnpm or yarn plug-n-play though you might have to switch to something else, there must be a bug in sass or something because the symlinked files don’t have the variables defined.
It would be useful to have a way of getting the overridden Vuetify SCSS vars inside Vue components.
Oh, that’s really interesting. Can’t you deep merge the different sets into an other variables, and
@usethat variable?@throrin19 Using
@use "vuetify/styles/settings/_index" as settings;works for me.I am theme vendor and I have two SCSS files from where vuetify SCSS variables can be overridden. However, the issue is we can’t do the below at the moment:
I tried the same without vuetify and everything is working perfectly.
I have reproduced the example: https://github.com/jd-solanki/vuetify-scss
mainbranch: Pure SCSS implementation (Working as expected)vuetify-issue: Trying to override vuetify SCSS vars from multiple files 😢Hello and happy new year gentlemen!
I’ve been facing something similar: are we talking about reusing elsewhere in the project the overridden Vuetify set of Sass variables? Extending a bit glen-84’s example, how can I
@usethe Vuetify settings, but including with my own values?Something like that:
main.scss
app.vue
This helped me
Not quite. It looks like it will make the import replacement more robust because it can be done with an importer now instead of relying on webpack/vite, but there’s still no stateful compiler.
I think that’s just referring to canonicalization.