Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Strategy to use fonts installed as npm packages #126

Open
fayazara opened this issue Apr 18, 2024 · 2 comments
Open

Strategy to use fonts installed as npm packages #126

fayazara opened this issue Apr 18, 2024 · 2 comments
Labels
enhancement New feature or request good first issue Good for newcomers provider

Comments

@fayazara
Copy link

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?

@danielroe danielroe added enhancement New feature or request good first issue Good for newcomers provider labels Apr 26, 2024
@oemer-aran
Copy link

oemer-aran commented Jul 5, 2024

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",
  ],
})

@frandmb
Copy link

frandmb commented Jul 17, 2024

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

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request good first issue Good for newcomers provider
Projects
None yet
Development

No branches or pull requests

4 participants