From 637537f486795d30d86390bc8ae45b1070965691 Mon Sep 17 00:00:00 2001 From: Garrick Aden-Buie Date: Fri, 18 Oct 2024 08:08:25 -0400 Subject: [PATCH] chore(brand): deduplicate font imports --- src/core/sass/brand.ts | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/src/core/sass/brand.ts b/src/core/sass/brand.ts index d4581b32f92..003670c0e6c 100644 --- a/src/core/sass/brand.ts +++ b/src/core/sass/brand.ts @@ -230,7 +230,7 @@ const brandTypographyBundle = ( "/* typography variables from _brand.yml */", '// quarto-scss-analysis-annotation { "action": "push", "origin": "_brand.yml typography" }', ]; - const typographyImports: string[] = []; + const typographyImports: Set = new Set(); const fonts = brand.data?.typography?.fonts ?? []; const pathCorrection = relative(brand.projectDir, brand.brandDir); @@ -268,10 +268,10 @@ const brandTypographyBundle = ( googleFamily = thisFamily; } else if (googleFamily !== thisFamily) { throw new Error( - `Inconsisent Google font families found: ${googleFamily} and ${thisFamily}`, + `Inconsistent Google font families found: ${googleFamily} and ${thisFamily}`, ); } - typographyImports.push(googleFontImportString(resolvedFont)); + typographyImports.add(googleFontImportString(resolvedFont)); } if (googleFamily === "") { return undefined; @@ -437,7 +437,7 @@ const brandTypographyBundle = ( // dependency: "bootstrap", quarto: { defaults: typographyVariables.join("\n"), - uses: typographyImports.join("\n"), + uses: Array.from(typographyImports).join("\n"), functions: "", mixins: "", rules: "",