From 31249e4c30487ff03f648d7c9b58fa6ede6e32a0 Mon Sep 17 00:00:00 2001 From: Peter Stather Date: Sat, 29 Jun 2024 01:39:19 +0100 Subject: [PATCH] Add textHighlight theme setting --- quartz.config.ts | 2 ++ quartz/styles/base.scss | 5 ++--- quartz/util/theme.ts | 3 +++ 3 files changed, 7 insertions(+), 3 deletions(-) diff --git a/quartz.config.ts b/quartz.config.ts index fa08723e9..b6abbb2d3 100644 --- a/quartz.config.ts +++ b/quartz.config.ts @@ -36,6 +36,7 @@ const config: QuartzConfig = { secondary: "#284b63", tertiary: "#84a59d", highlight: "rgba(143, 159, 169, 0.15)", + textHighlight: "#fff23688", }, darkMode: { light: "#161618", @@ -46,6 +47,7 @@ const config: QuartzConfig = { secondary: "#7b97aa", tertiary: "#84a59d", highlight: "rgba(143, 159, 169, 0.15)", + textHighlight: "#b3aa0288", }, }, }, diff --git a/quartz/styles/base.scss b/quartz/styles/base.scss index b023b2794..be427bcae 100644 --- a/quartz/styles/base.scss +++ b/quartz/styles/base.scss @@ -20,12 +20,11 @@ section { } .text-highlight { - background-color: #fff23688; + background-color: var(--textHighlight); padding: 0 0.1rem; border-radius: 5px; } - -::selection { +S ::selection { background: color-mix(in srgb, var(--tertiary) 60%, rgba(255, 255, 255, 0)); color: var(--darkgray); } diff --git a/quartz/util/theme.ts b/quartz/util/theme.ts index d3bfb9a0d..9046cec66 100644 --- a/quartz/util/theme.ts +++ b/quartz/util/theme.ts @@ -7,6 +7,7 @@ export interface ColorScheme { secondary: string tertiary: string highlight: string + textHighlight: string } interface Colors { @@ -49,6 +50,7 @@ ${stylesheet.join("\n\n")} --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}; @@ -64,6 +66,7 @@ ${stylesheet.join("\n\n")} --secondary: ${theme.colors.darkMode.secondary}; --tertiary: ${theme.colors.darkMode.tertiary}; --highlight: ${theme.colors.darkMode.highlight}; + --textHighlight: ${theme.colors.darkMode.textHighlight}; } ` }