fix indexing causing main thread freeze, various polish

This commit is contained in:
Jacky Zhao
2023-07-04 10:08:32 -07:00
parent e0ebee5aa9
commit ab9da02c60
33 changed files with 255 additions and 141 deletions

View File

@ -21,6 +21,8 @@ export interface Theme {
}
}
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`
@ -37,9 +39,9 @@ export function joinStyles(theme: Theme, ...stylesheet: string[]) {
--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"] {