[Feature Request] How i can use my own SASS file globally? #14727
-
Problem to solveI can't use my own sass file. I can only to override css class or set variables. But no posible to use a own Loading file: Proposed solutionLoad sass template via option. |
Beta Was this translation helpful? Give feedback.
Replies: 8 comments
-
I used @import in my App.vue file with style tags and it compiles and reloads |
Beta Was this translation helpful? Give feedback.
-
@ottz0 how it will work? can you please send a example.After you load vuetify intitally than the main.sass will also load. You have no choice! |
Beta Was this translation helpful? Give feedback.
-
Put it in your App.vue file and import it
|
Beta Was this translation helpful? Give feedback.
-
What you are describe, it's extend the main file and not a full placement! |
Beta Was this translation helpful? Give feedback.
-
Please explain what you're actually trying to do. |
Beta Was this translation helpful? Give feedback.
-
The File .v-application code {
background-color: #f5f5f5;
color: #bd4147;
box-shadow: 0px 2px 1px -1px rgba(0, 0, 0, 0.2), 0px 1px 1px 0px rgba(0, 0, 0, 0.14), 0px 1px 3px 0px rgba(0, 0, 0, 0.12);
} But i want use my own css style for the code tag and not overwrite this! |
Beta Was this translation helpful? Give feedback.
-
Hey @KaelWD, main.sass is always loaded by the default preset even if I want a different set of rules. E.g. I may not need any elevations and transitions in my app, therefor I'd like to exclude them, but I can't because they are included by default. It is always possible to use a webpack plugin to remove unused styles (e.g. css-byebye), but I'd rather prefer including only those that I really need. To solve my problem I forked vuetify and removed the main.sass import from the default preset, and indeed this works OK, but it would be better if I could take full control of what CSS rules are included without a fork. Note that this was possible in vuetify v1 (see install notes: Any suggestion for fixing this problem? Will the framework be more configurable in v3? We would love to continue using vuetify because it's a firm foundation, but performance and customizability are paramount in our apps, hence we would greatly appreciate efforts to improve these. Thanks a lot. |
Beta Was this translation helpful? Give feedback.
-
You can probably do something similar in v2 by removing the main.sass import with IgnorePlugin and recreating it yourself with only the desired styles.
Global styles are no longer included by default, you have to import |
Beta Was this translation helpful? Give feedback.
You can probably do something similar in v2 by removing the main.sass import with IgnorePlugin and recreating it yourself with only the desired styles.
Global styles are no longer included by default, you have to import
vuetify/styles
if you want them. The webpack and vite plugins also have astyles: false
option which removes component stylesheets too. We've also added sass variables to disable just the css reset or utility classes if you still want everything else.