Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

nuxt3 + vuetify3: not able to overwrite component sass variables #16295

Closed
falko-apheris opened this issue Dec 19, 2022 · 5 comments
Closed

nuxt3 + vuetify3: not able to overwrite component sass variables #16295

falko-apheris opened this issue Dec 19, 2022 · 5 comments
Assignees
Labels
C: VApp VApp T: bug Functionality that does not work as intended/expected
Milestone

Comments

@falko-apheris
Copy link

I have tried many variants but I am unable to overwrite component SASS variables. Here is my current attempt.

nuxt.config.ts

import vuetify from 'vite-plugin-vuetify';
export default defineNuxtConfig({
	modules: [
		async (options, nuxt) => {
			nuxt.hooks.hook('vite:extendConfig', (config) =>
				config.plugins.push(vuetify({styles: { configFile: './assets/variables.scss' }}))
			);
		},
	],
});

~/plugins/1.vuetify.ts

import 'vuetify/styles'
export default defineNuxtPlugin(({ vueApp }) => {
	const vuetify = createVuetify();
	vueApp.use(vuetify);
});

~/assets/variables.scss

@use 'vuetify/settings' with (
	// works
	$font-size-root: 16px,
	
	// does not work 
	// [vite] Internal server error: [sass] This variable was not declared with !default in the @used module.
	$application-color: $primary,
);

I would appreciate your help, or a hint where to go if this is not the appropriate location for my issue.

@KaelWD KaelWD transferred this issue from vuetifyjs/vuetify-loader Dec 19, 2022
@KaelWD KaelWD added T: bug Functionality that does not work as intended/expected C: VApp VApp labels Dec 19, 2022
@KaelWD KaelWD self-assigned this Dec 19, 2022
@KaelWD KaelWD added this to the v3.0.x milestone Dec 19, 2022
KaelWD added a commit that referenced this issue Dec 19, 2022
@falko-apheris
Copy link
Author

Awesome, thanks @KaelWD

@Dinuz
Copy link

Dinuz commented Jan 27, 2023

@KaelWD This works perfectly, except it generates a series of warning about sourcemap missing for each component used. For example: Sourcemap for "plugin-vuetify:styles/main.sass" points to missing source files or Sourcemap for "plugin-vuetify:components/VResponsive/VResponsive.sass" points to missing source files .

Screenshot 2023-01-26 at 7 36 07 PM

How I prevent the Warning? My setting is exactly like @falko-apheris .

@ElYaiko
Copy link

ElYaiko commented Feb 3, 2023

I got the same warnings too in 3.1.3

@fahmifitu
Copy link
Contributor

3.1.4 with the same warnings

@KaelWD
Copy link
Member

KaelWD commented Feb 8, 2023

@vuetifyjs vuetifyjs locked as off-topic and limited conversation to collaborators Feb 8, 2023
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
C: VApp VApp T: bug Functionality that does not work as intended/expected
Projects
None yet
Development

No branches or pull requests

5 participants