| | |
| | | secondary: string |
| | | tertiary: string |
| | | highlight: string |
| | | textHighlight: string |
| | | } |
| | | |
| | | interface Colors { |
| | | lightMode: ColorScheme |
| | | darkMode: ColorScheme |
| | | } |
| | | |
| | | export interface Theme { |
| | |
| | | body: string |
| | | code: string |
| | | } |
| | | colors: { |
| | | lightMode: ColorScheme |
| | | darkMode: ColorScheme |
| | | } |
| | | cdnCaching: boolean |
| | | colors: Colors |
| | | fontOrigin: "googleFonts" | "local" |
| | | } |
| | | |
| | | export type ThemeKey = keyof Colors |
| | | |
| | | const DEFAULT_SANS_SERIF = |
| | | '-apple-system, BlinkMacSystemFont, "Segoe UI", Helvetica, Arial, sans-serif' |
| | | const DEFAULT_MONO = "ui-monospace, SFMono-Regular, SF Mono, Menlo, monospace" |
| | |
| | | --secondary: ${theme.colors.lightMode.secondary}; |
| | | --tertiary: ${theme.colors.lightMode.tertiary}; |
| | | --highlight: ${theme.colors.lightMode.highlight}; |
| | | --textHighlight: ${theme.colors.lightMode.textHighlight}; |
| | | |
| | | --headerFont: ${theme.typography.header}, ${DEFAULT_SANS_SERIF}; |
| | | --bodyFont: ${theme.typography.body}, ${DEFAULT_SANS_SERIF}; |
| | | --codeFont: ${theme.typography.code}, ${DEFAULT_MONO}; |
| | | --headerFont: "${theme.typography.header}", ${DEFAULT_SANS_SERIF}; |
| | | --bodyFont: "${theme.typography.body}", ${DEFAULT_SANS_SERIF}; |
| | | --codeFont: "${theme.typography.code}", ${DEFAULT_MONO}; |
| | | } |
| | | |
| | | :root[saved-theme="dark"] { |
| | |
| | | --secondary: ${theme.colors.darkMode.secondary}; |
| | | --tertiary: ${theme.colors.darkMode.tertiary}; |
| | | --highlight: ${theme.colors.darkMode.highlight}; |
| | | --textHighlight: ${theme.colors.darkMode.textHighlight}; |
| | | } |
| | | ` |
| | | } |