From 8c3dad15e03ac3fa7ec504874206f08720a6dd32 Mon Sep 17 00:00:00 2001 From: Autumn Date: Thu, 10 Oct 2024 18:09:33 -0500 Subject: [PATCH] style: prettier --- quartz/util/theme.ts | 29 +++++++++++++++++------------ 1 file changed, 17 insertions(+), 12 deletions(-) diff --git a/quartz/util/theme.ts b/quartz/util/theme.ts index d368c706b..579b8bbec 100644 --- a/quartz/util/theme.ts +++ b/quartz/util/theme.ts @@ -19,11 +19,11 @@ interface FontInfo { /** * e.g. "ital,wght@0,400;1,200" */ - features: string, + features: string } export interface Theme { - fonts?: Record, + fonts?: Record typography: { header: string | string[] body: string | string[] @@ -42,14 +42,19 @@ const DEFAULT_MONO = "ui-monospace, SFMono-Regular, SF Mono, Menlo, monospace" function makeFamilySection(theme: Theme, family: string | string[], defaultFeatures: string) { const families = Array.isArray(family) ? family : [family] - return "family=" + families.map(f => { - const features = theme.fonts?.[f]?.features ?? defaultFeatures - if(features === "") { - return `${f}:wght@400` // matches unplugin-fonts; should be a sane default - } else { - return `${f}:${features}` - } - }).join("&family=") + return ( + "family=" + + families + .map((f) => { + const features = theme.fonts?.[f]?.features ?? defaultFeatures + if (features === "") { + return `${f}:wght@400` // matches unplugin-fonts; should be a sane default + } else { + return `${f}:${features}` + } + }) + .join("&family=") + ) } export function googleFontHref(theme: Theme) { @@ -63,8 +68,8 @@ export function googleFontHref(theme: Theme) { } function renderFonts(fonts: string | string[]) { - if(Array.isArray(fonts)) { - return fonts.map(s => `"${s}"`).join(", ") + if (Array.isArray(fonts)) { + return fonts.map((s) => `"${s}"`).join(", ") } else { return `"${fonts}"` }