I can't figure out how to change the default font in vuetify. I've been looking for the right variable within ./node_modules/vuetify, but I can't locate it.
I'd ideally not make any changes in the module, but would rather override such variables from outside the module.
vuetify: { customVariables: ['~/assets/variables. scss'], treeShake: true }, Finally, in order to change body and header fonts, you need to set the $body-font-family, $heading-font-family, and $font-size-root variables in /assets/variables.
Vuetify. js uses the Material Design spec Roboto Font. Each heading size also has a corresponding helper class to style other elements the same.
Changing text color and background color is easy with Vuetify, too. For the background color, simply add the name of the required color to the element's class. For text color, just add the color name followed by --text .
Vuetify is a component framework for Vue. js 2. It aims to provide clean, semantic and reusable components that make building your application a breeze. Vuetify utilizes Google's Material Design design pattern, taking cues from other popular frameworks such as Materialize.
Best way
Define (if you use google fonts)
@import url('https://fonts.googleapis.com/css? family=Oxygen:300,400,700&display=swap'); @import url('https://fonts.googleapis.com/css? family=Comfortaa&display=swap'); $body-font-family: 'Oxygen'; $title-font: 'Comfortaa';
For vuetify 2+
.v-application { font-family: $body-font-family, sans-serif !important; .title { // To pin point specific classes of some components font-family: $title-font, sans-serif !important; } }
In app.vue or a separate scss/css file imported directly into app.vue
For vuetify 1.5.x
In your app.vue script add
.application { font-family: "Font Family Name"; } .headline, .title, .subheading{ font-family: $body-font-family !important; }
For example, if you are using a google font, your script tag should look like
<style lang="scss"> @import url("https://fonts.googleapis.com/css?family=Questrial"); .application { font-family: "Questrial"; } </style>
In your main.scss
file,
$font-family:'Ubuntu' .v-application { [class*='text-'] { color: #36405a; font-family: $font-family, sans-serif !important; } font-family: $font-family, sans-serif !important; }
The easiest way would be to simply set the font-family on body
. If you are using webpack and importing the Vuetify stylus entry, main.styl
, you can simply overwrite the $font-family
variable with whatever font you want.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With