@dalton_moen
To use custom fonts in Vuetify, follow these steps:
1 2 3 4 5 6 7 8 |
@font-face { font-family: 'CustomFont'; src: url('~@/assets/fonts/CustomFont-Regular.ttf') format('truetype'); } body { font-family: 'CustomFont', sans-serif; } |
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 |
import Vue from 'vue'; import Vuetify from 'vuetify/lib'; Vue.use(Vuetify); export default new Vuetify({ theme: { themes: { light: { fonts: { customFont: 'CustomFont, sans-serif', }, }, }, }, }); |
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 |
<template> <v-app> <v-toolbar app color="primary"> <v-toolbar-title class="font-customFont">Custom Font Example</v-toolbar-title> </v-toolbar> </v-app> </template> <script> export default { name: 'CustomFontExample', }; </script> <style> .font-customFont { font-family: 'CustomFont', sans-serif; } </style> |
By following these steps, you will be able to use custom fonts in your Vuetify project.