Skip to content

fix: use badge colors for "auto" label to improve dark theme readability#562

Merged
rajbos merged 4 commits into
mainfrom
fix/auto-label-dark-theme-contrast
Apr 8, 2026
Merged

fix: use badge colors for "auto" label to improve dark theme readability#562
rajbos merged 4 commits into
mainfrom
fix/auto-label-dark-theme-contrast

Conversation

@rajbos

@rajbos rajbos commented Apr 8, 2026

Copy link
Copy Markdown
Owner

Fixes #559

Problem

The "auto" badge shown next to automatic tool names in the Usage Analysis panel was using --bg-secondary, --text-muted, and --border-subtle CSS variables. In dark-themed editors, --text-muted (mapped to vscode-disabledForeground) renders as a dim color against a similarly dark background, making the label hard to read.

Fix

Switch to --badge-bg / --badge-fg (mapped to VS Code's vscode-badge-background / vscode-badge-foreground tokens). These tokens are specifically designed by VS Code to maintain proper contrast in both light and dark themes. The explicit border was also removed since the badge background provides sufficient visual separation.

Before:

<span style="background:var(--bg-secondary); color:var(--text-muted); border:1px solid var(--border-subtle); ...">auto</span>

After:

<span style="background:var(--badge-bg); color:var(--badge-fg); ...">auto</span>

rajbos and others added 4 commits April 8, 2026 17:52
Fixes #559

The 'auto' badge on tool rows in the Usage Analysis panel was using
--bg-secondary / --text-muted / --border-subtle which have low contrast
against dark editor backgrounds.

Replace with --badge-bg / --badge-fg (mapped to VS Code's
vscode-badge-background / vscode-badge-foreground tokens) which are
designed to have proper contrast in both light and dark themes, and
remove the border since the badge background provides sufficient visual
separation.

Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
… contrast

Badge tokens (--badge-bg/fg) resolved to low-contrast colors in some
dark themes. Switch to a theme-agnostic outline style that uses
--text-secondary for both the border and text color, with a transparent
background. This works in all themes since the color inherits from the
editor's description text, which always has sufficient contrast.

Also moves the badge styling into a dedicated .auto-badge CSS class
instead of inline styles.

Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
--text-secondary (vscode-descriptionForeground) is too dark in some
dark themes. Switch to --text-primary (vscode-editor-foreground) at
55% opacity for both the border and text. VS Code guarantees the
primary foreground color is always readable against the editor
background, so this reliably produces visible but visually subtle
badge text in any theme.

Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
55% opacity was still too subdued. Use full primary foreground color
so the outlined badge is crisp and clearly readable in all themes.

Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
@rajbos rajbos merged commit 1d89b03 into main Apr 8, 2026
16 checks passed
@rajbos rajbos deleted the fix/auto-label-dark-theme-contrast branch April 8, 2026 16:39
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.

Auto label on tool selection hard to read in dark themed editor

1 participant