Skip to content

Commit 5154800

Browse files
Merge branch 'main' of github.com:cssninjaStudio/unplugin-fonts
2 parents 4f48b83 + 56777a3 commit 5154800

File tree

2 files changed

+10
-5
lines changed

2 files changed

+10
-5
lines changed

README.md

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -113,7 +113,7 @@ module.exports = {
113113

114114

115115
<details>
116-
<summary>SveltKit</summary><br>
116+
<summary>SvelteKit</summary><br>
117117

118118
```ts
119119
// vite.config.ts
@@ -462,7 +462,7 @@ or
462462
/// <reference types="unplugin-fonts/client" />
463463
```
464464

465-
## Ressources
465+
## Resources
466466

467467
- https://web.dev/optimize-webfont-loading/
468468
- https://csswizardry.com/2020/05/the-fastest-google-fonts/

src/types.ts

Lines changed: 8 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -108,13 +108,18 @@ export interface CustomFonts {
108108
stripPrefix?: string
109109
}
110110

111-
export interface FontsourceFontFamily {
111+
interface BaseFontsourceFontFamily {
112112
name: string
113-
variables?: ('variable' | 'variable-italic' | 'variable-full' | 'variable-full-italic')[]
114-
weights: (100 | 200 | 300 | 400 | 500 | 600 | 700 | 800 | 900)[]
115113
styles?: ('italic' | 'normal')[]
116114
subset?: string
117115
}
116+
interface WeightsFontsourceFontFamily extends BaseFontsourceFontFamily {
117+
weights: (100 | 200 | 300 | 400 | 500 | 600 | 700 | 800 | 900)[]
118+
}
119+
interface VariableFontsourceFontFamily extends BaseFontsourceFontFamily {
120+
variables: ('variable' | 'variable-italic' | 'variable-full' | 'variable-full-italic')[]
121+
}
122+
export type FontsourceFontFamily = WeightsFontsourceFontFamily | VariableFontsourceFontFamily
118123
export interface FontsourceFonts {
119124
families: (string | FontsourceFontFamily)[]
120125
}

0 commit comments

Comments
 (0)