You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: packages/docs/src/pages/en/getting-started/installation.md
+100Lines changed: 100 additions & 0 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -406,6 +406,106 @@ This will include all components and directives regardless of whether or not you
406
406
407
407
Lastly, do not forget to install [icons](/features/icon-fonts/).
408
408
409
+
## Fonts
410
+
411
+
Vuetify uses Roboto as its default font. To ensure your project renders correctly, you need to add the Roboto font yourself. We recommend using @fontsource/roboto or bundling with unplugin-fonts which is the default used in [vuetify-create](https://github.com/vuetifyjs/create) installations.
412
+
413
+
### Option A — Install via @fontsource/roboto
414
+
415
+
::: tabs
416
+
417
+
```bash [pnpm]
418
+
pnpm i @fontsource/roboto
419
+
```
420
+
421
+
```bash [yarn]
422
+
yarn add @fontsource/roboto
423
+
```
424
+
425
+
```bash [npm]
426
+
npm i @fontsource/roboto
427
+
```
428
+
429
+
```bash [bun]
430
+
bun add @fontsource/roboto
431
+
```
432
+
433
+
:::
434
+
435
+
Then import the styles you need in your main.ts or main.js:
436
+
437
+
```js
438
+
import'@fontsource/roboto/100.css'
439
+
import'@fontsource/roboto/300.css'
440
+
import'@fontsource/roboto/400.css'
441
+
import'@fontsource/roboto/500.css'
442
+
import'@fontsource/roboto/700.css'
443
+
import'@fontsource/roboto/900.css'
444
+
445
+
/* optional italic styles */
446
+
import'@fontsource/roboto/100-italic.css'
447
+
import'@fontsource/roboto/300-italic.css'
448
+
import'@fontsource/roboto/400-italic.css'
449
+
import'@fontsource/roboto/500-italic.css'
450
+
import'@fontsource/roboto/700-italic.css'
451
+
import'@fontsource/roboto/900-italic.css'
452
+
```
453
+
454
+
### Option B — Install via unplugin-fonts + @fontsource (recommended)
455
+
456
+
::: tabs
457
+
458
+
```bash [pnpm]
459
+
pnpm i --save-dev unplugin-fonts
460
+
pnpm i @fontsource/roboto
461
+
```
462
+
463
+
```bash [yarn]
464
+
yarn add --save-dev unplugin-fonts
465
+
yarn add @fontsource/roboto
466
+
```
467
+
468
+
```bash [npm]
469
+
npm i --save-dev unplugin-fonts
470
+
npm i @fontsource/roboto
471
+
```
472
+
473
+
```bash [bun]
474
+
bun add --save-dev unplugin-fonts
475
+
bun add @fontsource/roboto
476
+
```
477
+
478
+
:::
479
+
480
+
Update your vite.config.ts:
481
+
482
+
```ts
483
+
import { defineConfig } from'vite'
484
+
importViteFontsfrom'unplugin-fonts/vite'
485
+
486
+
exportdefaultdefineConfig({
487
+
plugins: [
488
+
ViteFonts({
489
+
fontsource: {
490
+
families: [
491
+
{
492
+
name: 'Roboto',
493
+
weights: [100, 300, 400, 500, 700, 900],
494
+
styles: ['normal', 'italic'],
495
+
},
496
+
],
497
+
},
498
+
}),
499
+
],
500
+
})
501
+
```
502
+
503
+
And import the generated CSS once in your main.ts or main.js:
504
+
505
+
```ts
506
+
import'unfonts.css'
507
+
```
508
+
409
509
## SSR caveats
410
510
411
511
Vue 3 has no way to automatically detect if SSR is used — so nuxt, gridsome, and other SSR frameworks must manually set the `ssr` option to `true` in order to properly render the application.
0 commit comments