Skip to content

Fix: Fix Code Block Styles in Editor (Light Mode)#95

Open
DaanVersteeg wants to merge 1 commit into0010aor:mainfrom
pjbruijne:light-mode-codeblock
Open

Fix: Fix Code Block Styles in Editor (Light Mode)#95
DaanVersteeg wants to merge 1 commit into0010aor:mainfrom
pjbruijne:light-mode-codeblock

Conversation

@DaanVersteeg
Copy link

Fixes #40 Code Blocks in the card editor displayed incorrect text colors.

Changes

frontend/src/theme.tsx

  • Adjusted the code background token for light mode from #f0f0f3 to #e4e4e7 (same color as menu bar) for a slightly stronger contrast against the page background.
  • Added a new semantic fg.code color token:
    • _light: '{colors.gray.700}' — dark enough to be legible on a light background
    • _dark: '{colors.gray.300}' — unchanged soft tone for dark mode

frontend/src/components/commonUI/RichText/RichText.styles.css

  • Replaced the hardcoded color: #d4d4d4 on pre blocks (a light gray that was invisible in light mode) with color: var(--chakra-colors-fg-code), which now correctly resolves per theme.
  • Added the same color: var(--chakra-colors-fg-code) to inline code elements, which previously had no explicit foreground color at all.
Schermafbeelding 2026-03-22 182448

Root cause

The pre block had a hardcoded color (#d4d4d4) that only worked in dark mode. In light mode this rendered near-white text on a light background, making code essentially invisible. Inline code blocks had no foreground color set at all, so they also fell through to an unreadable default.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Fix Code Block Styles in Editor (Light Mode)

1 participant