From 429f331c212d598b0d7ff44f20f75cf007bcf32b Mon Sep 17 00:00:00 2001
From: Jacky Zhao <j.zhao2k19@gmail.com>
Date: Thu, 03 Aug 2023 03:53:13 +0000
Subject: [PATCH] make ci also run on windows, re-add css minification

---
 quartz/theme.ts |   38 +++++++++++++++++++++-----------------
 1 files changed, 21 insertions(+), 17 deletions(-)

diff --git a/quartz/theme.ts b/quartz/theme.ts
index 7677b25..8d7b727 100644
--- a/quartz/theme.ts
+++ b/quartz/theme.ts
@@ -1,33 +1,39 @@
 export interface ColorScheme {
-  light: string,
-  lightgray: string,
-  gray: string,
-  darkgray: string,
-  dark: string,
-  secondary: string,
-  tertiary: string,
+  light: string
+  lightgray: string
+  gray: string
+  darkgray: string
+  dark: string
+  secondary: string
+  tertiary: string
   highlight: string
 }
 
 export interface Theme {
   typography: {
-    header: string,
-    body: string,
+    header: string
+    body: string
     code: string
-  },
+  }
   colors: {
-    lightMode: ColorScheme,
+    lightMode: ColorScheme
     darkMode: ColorScheme
   }
 }
 
+const DEFAULT_SANS_SERIF =
+  '-apple-system, BlinkMacSystemFont, "Segoe UI", Helvetica, Arial, sans-serif'
+const DEFAULT_MONO = "ui-monospace, SFMono-Regular, SF Mono, Menlo, monospace"
+
 export function googleFontHref(theme: Theme) {
   const { code, header, body } = theme.typography
   return `https://fonts.googleapis.com/css2?family=${code}&family=${header}:wght@400;700&family=${body}:ital,wght@0,400;0,600;1,400;1,600&display=swap`
 }
 
-export function templateThemeStyles(theme: Theme, stylesheet: string) {
+export function joinStyles(theme: Theme, ...stylesheet: string[]) {
   return `
+${stylesheet.join("\n\n")}
+
 :root {
   --light: ${theme.colors.lightMode.light};
   --lightgray: ${theme.colors.lightMode.lightgray};
@@ -38,9 +44,9 @@
   --tertiary: ${theme.colors.lightMode.tertiary};
   --highlight: ${theme.colors.lightMode.highlight};
 
-  --headerFont: ${theme.typography.header};
-  --bodyFont: ${theme.typography.body};
-  --codeFont: ${theme.typography.code};
+  --headerFont: ${theme.typography.header}, ${DEFAULT_SANS_SERIF};
+  --bodyFont: ${theme.typography.body}, ${DEFAULT_SANS_SERIF};
+  --codeFont: ${theme.typography.code}, ${DEFAULT_MONO};
 }
 
 :root[saved-theme="dark"] {
@@ -53,7 +59,5 @@
   --tertiary: ${theme.colors.darkMode.tertiary};
   --highlight: ${theme.colors.darkMode.highlight};
 }
-
-${stylesheet}
 `
 }

--
Gitblit v1.10.0