From cbae88fc4e9b98764cfccca2e85f265c4b894573 Mon Sep 17 00:00:00 2001
From: Adam Brangenberg <adambrangenberg@proton.me>
Date: Mon, 31 Jul 2023 04:08:32 +0000
Subject: [PATCH] Removing redundant properties (#356)
---
quartz/theme.ts | 34 +++++++++++++++++++---------------
1 files changed, 19 insertions(+), 15 deletions(-)
diff --git a/quartz/theme.ts b/quartz/theme.ts
index 820519f..8d7b727 100644
--- a/quartz/theme.ts
+++ b/quartz/theme.ts
@@ -1,35 +1,40 @@
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_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 joinStyles(theme: Theme, ...stylesheet: string[]) {
- return `:root {
+ return `
+${stylesheet.join("\n\n")}
+
+:root {
--light: ${theme.colors.lightMode.light};
--lightgray: ${theme.colors.lightMode.lightgray};
--gray: ${theme.colors.lightMode.gray};
@@ -54,6 +59,5 @@
--tertiary: ${theme.colors.darkMode.tertiary};
--highlight: ${theme.colors.darkMode.highlight};
}
-
-${stylesheet.join("\n\n")}`
+`
}
--
Gitblit v1.10.0