Skip to content

fix: prevent Django admin dark mode from breaking editor text color#325

Open
gghez wants to merge 1 commit into
hvlads:masterfrom
gghez:fix/dark-mode-text-color
Open

fix: prevent Django admin dark mode from breaking editor text color#325
gghez wants to merge 1 commit into
hvlads:masterfrom
gghez:fix/dark-mode-text-color

Conversation

@gghez
Copy link
Copy Markdown

@gghez gghez commented Mar 24, 2026

Summary

  • When Django admin is in dark mode, color: white on body cascades into the CKEditor content area, making text invisible (white on white).
  • Explicitly set color and background on .ck-content using CKEditor's own CSS variables (--ck-color-text and --ck-color-base-background), breaking the inheritance chain.
  • Custom dark themes via CKEDITOR_5_CUSTOM_CSS still work — they override the same variables.

Closes #305

Test plan

  • Open Django admin with prefers-color-scheme: dark — editor text should be dark on white background
  • Switch to light mode — no visual change (was already working)
  • If using CKEDITOR_5_CUSTOM_CSS with dark CKEditor variables — editor should render with custom dark theme

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.

Dark mode problem

1 participant