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

Fixes bug in fontsource.ts when style is normal #52

Merged
merged 1 commit into from
Jul 27, 2023

Conversation

holgerkoser
Copy link
Contributor

Problem

Currently, the plugin configuration

Unfonts({
  fontsource: {
    families: [
      {
        name: 'Roboto',
        weights: [400],
        styles: ['normal', 'italic'],
        subset: 'latin',
      },
    ],
  },
}),

generates an error:

[vite:css] [postcss] ENOENT: no such file or directory, open '@fontsource/roboto/latin-normal.css'
file: unfonts.css:undefined:undefined
error during build:
Error: [postcss] ENOENT: no such file or directory, open '@fontsource/roboto/latin-normal.css'

Expected Solution

The configuration should lead to the successful loading of the following files:

@fontsource/roboto/latin-400.css
@fontsource/roboto/latin-400-italic.css

If the style is set to normal, the style should not be included in the file name; instead, the weight should be retained.

In case of style normal the style should be omitted not the weight
@stafyniaksacha stafyniaksacha merged commit 1253f4d into cssninjaStudio:main Jul 27, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants