From e72b1c4bb8a1c7e046e8aaa0d40df4514466d73f Mon Sep 17 00:00:00 2001 From: Fernando Araoz Date: Sun, 26 Jan 2025 09:07:36 -0500 Subject: [PATCH] fix: shiky styles --- astro.config.mjs | 4 ++-- public/blog.css | 22 ++++++++++++++++++++-- public/global.css | 4 ++++ 3 files changed, 26 insertions(+), 4 deletions(-) diff --git a/astro.config.mjs b/astro.config.mjs index 90ec3b5..281a79a 100644 --- a/astro.config.mjs +++ b/astro.config.mjs @@ -16,8 +16,8 @@ export default defineConfig({ markdown: { shikiConfig: { themes: { - light: "light-plus", - dark: "dark-plus" + light: "github-light", + dark: "github-dark" }, transformers: [ transformerNotationDiff(), diff --git a/public/blog.css b/public/blog.css index 7e7773e..b272ce5 100644 --- a/public/blog.css +++ b/public/blog.css @@ -100,19 +100,37 @@ pre.astro-code>code .line::before { /* Shiki transformers */ .astro-code { - --shiki-highlight-color: #cccccc; + --shiki-highlight-color: #e0e0e0; --shiki-highlight-word-color: #aaaaaa; --shiki-error-bg-color: rgba(244, 63, 63, 0.25); } +.astro-code, +.astro-code span { + color: var(--shiki-light) !important; + /* Optional, if you also want font styles */ + font-style: var(--shiki-light-font-style) !important; + font-weight: var(--shiki-light-font-weight) !important; + text-decoration: var(--shiki-light-text-decoration) !important; +} + @media (prefers-color-scheme: dark) { .astro-code { - --shiki-highlight-color: #343434; + --shiki-highlight-color: #192224; --shiki-highlight-word-color: #3a3a3a; --shiki-error-bg-color: rgba(244, 63, 94, 0.16); } + .astro-code, + .astro-code span { + color: var(--shiki-dark) !important; + /* Optional, if you also want font styles */ + font-style: var(--shiki-dark-font-style) !important; + font-weight: var(--shiki-dark-font-weight) !important; + text-decoration: var(--shiki-dark-text-decoration) !important; + } } + .line { display: inline-block; width: 100%; diff --git a/public/global.css b/public/global.css index a7189dc..6f42d1a 100644 --- a/public/global.css +++ b/public/global.css @@ -51,3 +51,7 @@ body { font-family: var(--font-body); font-optical-sizing: auto; } + +code { + font-family: var(--font-mono) !important; +}