Skip to content

Commit 9d866bd

Browse files
authored
Merge pull request #11104 from quarto-dev/brand/dedupe-font-imports
chore(brand): deduplicate font imports
2 parents f3b2f70 + 637537f commit 9d866bd

File tree

1 file changed

+4
-4
lines changed

1 file changed

+4
-4
lines changed

src/core/sass/brand.ts

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -230,7 +230,7 @@ const brandTypographyBundle = (
230230
"/* typography variables from _brand.yml */",
231231
'// quarto-scss-analysis-annotation { "action": "push", "origin": "_brand.yml typography" }',
232232
];
233-
const typographyImports: string[] = [];
233+
const typographyImports: Set<string> = new Set();
234234
const fonts = brand.data?.typography?.fonts ?? [];
235235

236236
const pathCorrection = relative(brand.projectDir, brand.brandDir);
@@ -268,10 +268,10 @@ const brandTypographyBundle = (
268268
googleFamily = thisFamily;
269269
} else if (googleFamily !== thisFamily) {
270270
throw new Error(
271-
`Inconsisent Google font families found: ${googleFamily} and ${thisFamily}`,
271+
`Inconsistent Google font families found: ${googleFamily} and ${thisFamily}`,
272272
);
273273
}
274-
typographyImports.push(googleFontImportString(resolvedFont));
274+
typographyImports.add(googleFontImportString(resolvedFont));
275275
}
276276
if (googleFamily === "") {
277277
return undefined;
@@ -441,7 +441,7 @@ const brandTypographyBundle = (
441441
// dependency: "bootstrap",
442442
quarto: {
443443
defaults: typographyVariables.join("\n"),
444-
uses: typographyImports.join("\n"),
444+
uses: Array.from(typographyImports).join("\n"),
445445
functions: "",
446446
mixins: "",
447447
rules: "",

0 commit comments

Comments
 (0)