vuetifyjs / create

🛠️ Build tooling for Vuetify 3
62 stars 19 forks source link

Add Roboto font as dependency instead of using Google-hosted fonts #59

Open romankaravia opened 2 months ago

romankaravia commented 2 months ago

This is a proposal to install the Roboto font as a dependency of create-vuetify instead of using Google-hosted fonts.

Current situation

Proposed improvement

A way to fix all of the above issues could be to use unplugin-fonts (existing dependency), add @fontsource/roboto, remove roboto-fontface, and adapt the unplugin-fonts config to use the locally installed Roboto font and also add italic style. See also detailed description in this issue comment.

I'd be happy to have a go at implementing this, but would first like to get some feedback about whether such a change would be welcomed by the maintainer(s) or not.

segevfiner commented 3 weeks ago

Basically configuring:

import ViteFonts from "unplugin-fonts/vite";

export default defineConfig({
  plugins: [
    ViteFonts({
      fontsource: {
        families: [
          {
            name: "Roboto",
            weights: [100, 300, 400, 500, 700, 900],
            styles: ["normal", "italic"],
          },
        ],
      },
    }),
  ],
});

Which I personally prefer and change my projects to use that too.