-
Notifications
You must be signed in to change notification settings - Fork 24
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
Unable to Use Vuetify Sass Variables #115
Comments
@mostafaznv I'm not a sass/scss expert, you can check https://github.com/Pinegrow/pg-nuxt-vuetify or ask in nuxt channel in vuetify discord server |
I don't believe it's directly related to Vuetify itself. Regardless, thank you for sharing that repository. I’ll take a look and hope it provides a solution. |
@mostafaznv maybe adding a custom module reordering vite config entry... |
No, neither the |
Hi @mostafaznv, do you have a sample repo I can have a look? I think I encountered this in the past. |
If you look closely into https://github.com/Pinegrow/pg-nuxt-vuetify, you will notice the there are two sass files & they are configured differently to how you have in your nuxt.config.ts. Also take a note of |
Hi @TechAkayy this is a reproduction link: |
Hey mate, I'm not a sass expert either, my efforts have been purely trial & error. This is the best I could do - https://stackblitz.com/edit/nuxt-starter-sndsr7?file=nuxt.config.ts. Refer to these files I have updated and compare with yours:
The below variables.scss is a new addition when compared to https://github.com/Pinegrow/pg-nuxt-vuetify. Again, this is based on my assumption that when imported via app.vue, it overrides the css/scss imports of nuxt config. Not sure if it really works. If you are an sass expert, you might probably know better than me :-)
You can find comment with my initial |
In settings.scss, try updating |
Also, check my reply here - nuxt/nuxt#15412 (comment) |
Thank you very much, @TechAkayy. For example, in one of my Vue components, I want to write a small piece of CSS to handle responsive styling on mobile. I used to do it using this technique, but I can't do it now: <style lang="scss">
.v-btn {
@media #{map-get($display-breakpoints, 'sm-and-down')} {
font-size: 12px;
}
}
</style> |
Ohh okay.. I'm guessing there should be a way to acheive what you are trying to do. I have updated variables.scss - https://stackblitz.com/edit/nuxt-starter-sndsr7?file=assets%2Fvariables.scss. Not sure how to test responsive sizes on stackblitz. Again, not sure if it works! You are not alone in this sassy ordeal ;-) |
Finally, it worked. Thanks ❤️ However, there is a setback here. Both However, I can't do it now, and I have to import But I think it's okay. It's nothing to stop me from using this incredible module. I have an off-topic question too 😄. locale: {
locale: 'fa',
fallback: 'en',
rtl: {
fa: true
},
}, However, I think it's being ignored, and my layout renders LTR. |
@mostafaznv it seems you're using the rtl properly (from docs: https://vuetifyjs.com/en/features/internationalization/#creating-a-custom-locale), can you check virtual vuetify module configuration and check if the options are ok? You can use Nuxt DevTools or browser dev tools (in browser check the |
{
"defaults": {
"VAppBar": {
"elevation": 0
},
"VBtn": {
"color": "primary",
"variant": "flat",
"size": "default"
},
},
"locale": {},
"theme": {
"defaultTheme": "light",
"themes": {
"light": {
"dark": false,
"colors": {
"background": "#FFF",
"surface": "#FFF",
"primary": "#000066",
"secondary": "#35373D",
"error": "#FA4343",
"info": "#345191",
"success": "#00966D",
"warning": "#FAB005"
}
},
"dark": {}
},
"variations": {
"colors": [
"primary",
"secondary"
],
"lighten": 3,
"darken": 3
}
},
"ssr": true
} |
@mostafaznv can you file a new issue (with a simple repo 🙏)? uhmm, ok, you're using i18n, check the playground... you need to configure i18n module properly |
@mostafaznv you also need to add the vuetify translations in your i18n files (json/ts/js) under Here a few entries used in the playground: https://github.com/userquin/vuetify-nuxt-module/blob/main/playground/locales/single/en-US.json#L3 Just copy/paste this to your fa i18n file (update the entries, some missing and maybe wrongly translated): https://github.com/vuetifyjs/vuetify/blob/master/packages/vuetify/src/locale/fa.ts |
I don't think there's a need to create a new issue. The problem has been solved. I was using nuxt-i18n, which was the main reason for not loading UI with RTL styles. After checking the playground and configuring i18n properly, the issue is resolved. Thank you to you and @TechAkayy for your helps. |
issue pinned |
@mostafaznv Example: https://stackblitz.com/edit/nuxt-starter-6ndxme?file=nuxt.config.ts Pay attention to nuxt.config.ts -> Vite -> css -> preprocessorOptions -> scss -> additionalData |
Hi.
Thank you for this excellent library. It surpasses the official
vite-plugin-vuetify
plugin by miles.However, I've encountered an issue. I'm not sure if it's a bug or if something in my configuration is incorrect. I hope someone can help me.
I want to use some of Vuetify's SASS variables (such as
$display-breakpoints
) in my project, but I'm facing difficulties.This is my
nuxt.config.ts
file:And this is
assets/styles/vuetify.scss
:But I encountered this error:
The text was updated successfully, but these errors were encountered: