fix(frontend): theme-aware code block background in prose markdown (#9968)

This commit is contained in:
Guilhem
2026-07-06 20:22:31 +02:00
committed by GitHub
parent 3dcd3949a1
commit 9821596251
+14
View File
@@ -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'
},