Skip to content

Commit e38a9a2

Browse files
committed
fix: use more descriptive parameter for skipFontFaceGeneration
1 parent 18b71e6 commit e38a9a2

File tree

2 files changed

+3
-3
lines changed

2 files changed

+3
-3
lines changed

README.md

+1-1
Original file line numberDiff line numberDiff line change
@@ -54,7 +54,7 @@ const options = {
5454
resolvePath: (id) => 'file:///path/to/public/dir' + id,
5555
// overrideName: (originalName) => `${name} override`
5656
// sourcemap: false
57-
// skipFontFaceGeneration: (fontFamily) => fontFamily === 'Roboto'
57+
// skipFontFaceGeneration: (fallbackName) => fallbackName === 'Roboto override'
5858
}
5959

6060
// Vite

src/transform.ts

+2-2
Original file line numberDiff line numberDiff line change
@@ -17,7 +17,7 @@ export interface FontaineTransformOptions {
1717
css?: { value?: string }
1818
fallbacks: string[]
1919
resolvePath?: (path: string) => string | URL
20-
skipFontFaceGeneration?: (name: string) => boolean
20+
skipFontFaceGeneration?: (fallbackName: string) => boolean
2121
/** this should produce an unquoted font family name */
2222
fallbackName?: (name: string) => string
2323
/** @deprecated use fallbackName */
@@ -66,7 +66,7 @@ export const FontaineTransform = createUnplugin(
6666
for (const { family, source } of parseFontFace(matchContent)) {
6767
if (!family) continue
6868
if (!supportedExtensions.some(e => source?.endsWith(e))) continue
69-
if (skipFontFaceGeneration(family)) continue
69+
if (skipFontFaceGeneration(fallbackName(family))) continue
7070

7171
const metrics =
7272
(await getMetricsForFamily(family)) ||

0 commit comments

Comments
 (0)