Skip to content

fix: make the rename symbol popup readable in dark mode#10091

Merged
mscolnick merged 3 commits into
mainfrom
fix/9197-rename-popup-dark-mode
Jul 8, 2026
Merged

fix: make the rename symbol popup readable in dark mode#10091
mscolnick merged 3 commits into
mainfrom
fix/9197-rename-popup-dark-mode

Conversation

@mscolnick

Copy link
Copy Markdown
Contributor

The F2 rename popup is rendered by @marimo-team/codemirror-languageserver,
which hardcodes background: white on the popup and sets no color on its
input as inline styles. In dark mode this produced light text on a white
background (unreadable). Add a CSS override in codemirror.css using the
existing theme tokens so the popup follows light/dark themes. !important
is required to beat the upstream inline styles; the popup is appended to
document.body so it is not scoped under #root.

Fixes #9197

The F2 rename popup is rendered by @marimo-team/codemirror-languageserver,
which hardcodes `background: white` on the popup and sets no color on its
input as inline styles. In dark mode this produced light text on a white
background (unreadable). Add a CSS override in codemirror.css using the
existing theme tokens so the popup follows light/dark themes. `!important`
is required to beat the upstream inline styles; the popup is appended to
document.body so it is not scoped under #root.

Fixes #9197
Copilot AI review requested due to automatic review settings July 7, 2026 19:39
@vercel

vercel Bot commented Jul 7, 2026

Copy link
Copy Markdown

The latest updates on your projects. Learn more about Vercel for GitHub.

Project Deployment Actions Updated (UTC)
marimo-docs Ready Ready Preview, Comment Jul 8, 2026 2:43am

Request Review

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

Fixes the CodeMirror F2 “rename symbol” popup styling so it remains readable in dark mode by overriding upstream inline styles with marimo theme tokens.

Changes:

  • Add global CSS overrides for .cm-rename-popup and its input to use --popover/--popover-foreground and --background/--foreground tokens.
  • Use !important to reliably override upstream inline styling for a popup appended to document.body (outside #root).

@cubic-dev-ai cubic-dev-ai Bot left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

No issues found across 1 file

Architecture diagram
sequenceDiagram
    participant User as Developer (F2 key)
    participant Editor as CodeMirror Editor
    participant LS as codemirror-languageserver
    participant Body as document.body
    participant CSS as codemirror.css
    participant Renderer as Browser Renderer

    User->>Editor: Press F2
    Editor->>LS: Trigger rename
    LS->>LS: Create popup element with inline styles (background: white, no color on input)
    LS->>Body: Append .cm-rename-popup to document.body
    Note over LS,Body: Popup not scoped under #root
    CSS->>CSS: Apply .cm-rename-popup overrides with !important
    Note over CSS: Uses var(--popover), var(--border), var(--foreground) etc.
    CSS->>Renderer: Declare overridden styles
    Renderer->>Renderer: Repaint popup with theme tokens
    Renderer-->>User: Popup readable in dark/light mode
Loading

Re-trigger cubic

@Light2Dark Light2Dark added the bug Something isn't working label Jul 8, 2026
Light2Dark
Light2Dark previously approved these changes Jul 8, 2026
Comment thread frontend/src/css/app/codemirror.css Outdated
@mscolnick mscolnick merged commit e1f7422 into main Jul 8, 2026
32 checks passed
@mscolnick mscolnick deleted the fix/9197-rename-popup-dark-mode branch July 8, 2026 14:37
@github-actions

github-actions Bot commented Jul 8, 2026

Copy link
Copy Markdown
Contributor

🚀 Development release published. You may be able to view the changes at https://marimo.app?v=0.23.14-dev24

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

Labels

bug Something isn't working

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Rename variable text contrast too low when not highlighted and in dark mode

3 participants