From 9821596251cff698958ffbfbd11fffa6a7988c6c Mon Sep 17 00:00:00 2001 From: Guilhem Date: Mon, 6 Jul 2026 20:22:31 +0200 Subject: [PATCH] fix(frontend): theme-aware code block background in prose markdown (#9968) --- frontend/tailwind.config.cjs | 14 ++++++++++++++ 1 file changed, 14 insertions(+) diff --git a/frontend/tailwind.config.cjs b/frontend/tailwind.config.cjs index 39e43c7722..5fb8a3fcfa 100644 --- a/frontend/tailwind.config.cjs +++ b/frontend/tailwind.config.cjs @@ -456,6 +456,20 @@ const config = { ] }, extend: { + // Tailwind Typography hardcodes `pre` code blocks to a dark background + // (gray-800) in both light and dark mode, so they render dark-on-light in + // light mode. Point the pre/pre-code variables at theme-aware surface + // tokens (light and inverted) so code blocks track the active theme. + typography: { + DEFAULT: { + css: { + '--tw-prose-pre-bg': 'rgb(var(--color-surface-secondary))', + '--tw-prose-pre-code': 'rgb(var(--color-text-primary))', + '--tw-prose-invert-pre-bg': 'rgb(var(--color-surface-secondary))', + '--tw-prose-invert-pre-code': 'rgb(var(--color-text-primary))' + } + } + }, border: { color: 'red' },