From 0026aec4878474a12fcb0e3f80c7634ff3d68045 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Sym=C3=A9on=20Smith?= Date: Wed, 28 Jan 2026 14:27:46 +0100 Subject: [PATCH 1/2] feat: use github-light theme on light mode --- app/assets/main.css | 12 +++++++++++- server/utils/code-highlight.ts | 3 ++- server/utils/shiki.ts | 5 +++-- 3 files changed, 16 insertions(+), 4 deletions(-) diff --git a/app/assets/main.css b/app/assets/main.css index 902b916e15..8e2e5201f7 100644 --- a/app/assets/main.css +++ b/app/assets/main.css @@ -157,6 +157,16 @@ button { top: 0; } +/* Shiki theme colors */ +html.light .shiki, +html.light .shiki span { + color: var(--shiki-light) !important; + background-color: var(--shiki-light-bg) !important; + font-style: var(--shiki-light-font-style) !important; + font-weight: var(--shiki-light-font-weight) !important; + text-decoration: var(--shiki-light-text-decoration) !important; +} + /* README prose styling */ .readme-content { color: var(--fg-muted); @@ -238,7 +248,7 @@ button { .readme-content pre, .readme-content .shiki { background: oklch(0.145 0 0) !important; - border: 1px solid oklch(0.2686 0 0); + border: 1px solid var(--border); border-radius: 8px; padding: 1rem; overflow-x: auto; diff --git a/server/utils/code-highlight.ts b/server/utils/code-highlight.ts index b8933597a6..1b982b310b 100644 --- a/server/utils/code-highlight.ts +++ b/server/utils/code-highlight.ts @@ -265,7 +265,8 @@ export async function highlightCode( try { let html = shiki.codeToHtml(code, { lang: language, - theme: 'github-dark', + themes: { light: 'github-light', dark: 'github-dark' }, + defaultColor: 'dark', }) // Shiki doesn't encode > in text content (e.g., arrow functions) diff --git a/server/utils/shiki.ts b/server/utils/shiki.ts index ef61c98562..8f6703ff01 100644 --- a/server/utils/shiki.ts +++ b/server/utils/shiki.ts @@ -6,7 +6,7 @@ let highlighter: HighlighterCore | null = null export async function getShikiHighlighter(): Promise { if (!highlighter) { highlighter = await createHighlighterCore({ - themes: [import('@shikijs/themes/github-dark')], + themes: [import('@shikijs/themes/github-dark'), import('@shikijs/themes/github-light')], langs: [ // Core web languages import('@shikijs/langs/javascript'), @@ -66,7 +66,8 @@ export function highlightCodeSync(shiki: HighlighterCore, code: string, language try { let html = shiki.codeToHtml(code, { lang: language, - theme: 'github-dark', + themes: { light: 'github-light', dark: 'github-dark' }, + defaultColor: 'dark', }) // Remove inline style from
 tag so CSS can control appearance
       html = html.replace(/]*)\s+style="[^"]*"/, '
Date: Wed, 28 Jan 2026 14:41:33 +0100
Subject: [PATCH 2/2] chore: update test for new code theme

---
 test/unit/docs-text.spec.ts | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

diff --git a/test/unit/docs-text.spec.ts b/test/unit/docs-text.spec.ts
index c1cda381e5..aa9b2f0547 100644
--- a/test/unit/docs-text.spec.ts
+++ b/test/unit/docs-text.spec.ts
@@ -242,8 +242,8 @@ describe('renderMarkdown', () => {
     const input = '```ts\nconst a = 1\n```\n\nSome text\n\n```js\nconst b = 2\n```'
     const result = await renderMarkdown(input, emptyLookup)
     expect(result).toContain('Some text')
-    // Both code blocks should be highlighted
-    expect((result.match(/shiki/g) || []).length).toBe(2)
+    // Both code blocks should be highlighted, search for `shiki` class
+    expect((result.match(/["\s]shiki["\s]/g) || []).length).toBe(2)
   })
 
   it('should not confuse inline code with fenced code blocks', async () => {