fonts
fonts copied to clipboard
Strategy to use fonts installed as npm packages
So, there's fonts like Cal Sans and Geist, which are installed usually as packages and imported, what's the best way to use these?
Is this what you are looking for?
export default defineNuxtConfig({
css: [
"@fontsource/roboto/100.css",
"@fontsource/roboto/300.css",
"@fontsource/roboto/400.css",
"@fontsource/roboto/500.css",
"@fontsource/roboto/700.css",
"@fontsource/roboto/900.css",
],
})
Is this what you are looking for?
export default defineNuxtConfig({ css: [ "@fontsource/roboto/100.css", "@fontsource/roboto/300.css", "@fontsource/roboto/400.css", "@fontsource/roboto/500.css", "@fontsource/roboto/700.css", "@fontsource/roboto/900.css", ], })
While this works, I suppose that having an optional way to tell the 'local' provider to scan a set of subfolders or /node_modules instead of /public could help with FontSource and other npm served fonts, it'd also eliminate the need to specify each weight