From 5b7d3a81e74ef9b636e76b9996f9afdf4275ea6b Mon Sep 17 00:00:00 2001 From: qwerzl <46770502+qwerzl@users.noreply.github.com> Date: Wed, 6 Mar 2024 18:51:34 +0800 Subject: [PATCH] fix(google): sort resolved variants when fetching font css (#33) --- src/providers/google.ts | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/providers/google.ts b/src/providers/google.ts index 6162e36..c1c8268 100644 --- a/src/providers/google.ts +++ b/src/providers/google.ts @@ -76,7 +76,7 @@ async function getFontDetails (family: string, variants: ResolveFontFacesOptions const weights = variableWeight ? [`${variableWeight.min}..${variableWeight.max}`] : variants.weights.filter(weight => String(weight) in font.fonts) - const resolvedVariants = weights.flatMap(w => [...styles].map(s => `${s},${w}`)) + const resolvedVariants = weights.flatMap(w => [...styles].map(s => `${s},${w}`)).sort() let css = ''