Skip to content

Fix TreeView checkbox styling to align with theme colors #255095

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Draft
wants to merge 2 commits into
base: main
Choose a base branch
from

Conversation

Copilot
Copy link
Contributor

@Copilot Copilot AI commented Jul 10, 2025

TreeView checkboxes were using the Toggle class with inputActiveOption* colors, causing them to turn blue when checked instead of following the current theme colors. This made them inconsistent with other checkboxes throughout VS Code.

Problem

The issue was a mismatch between the CSS and JavaScript implementation:

  • CSS: Already set up to use proper checkbox theme colors (--vscode-checkbox-* variables)
  • JavaScript: Creating DOM elements with Toggle class using input option colors

Solution

Replace Toggle with Checkbox in the TreeItemCheckbox class to align the code with the CSS expectations.

Changes Made

  1. Import changes:

    • Replaced Toggle import with Checkbox import
    • Replaced defaultToggleStyles with defaultCheckboxStyles
    • Removed unused Codicon import
  2. Implementation changes:

    • Changed private toggle: Toggle to private checkbox: Checkbox
    • Updated constructor to use Checkbox format: new Checkbox(title, isChecked, styles)
    • Removed manual icon handling (Checkbox handles check mark internally)
    • Added hoverDelegate to checkbox styles for proper hover behavior
  3. Method updates: Updated all references from toggle to checkbox

Result

  • Before: TreeView checkboxes turned blue when checked (using input option colors)
  • After: TreeView checkboxes now use consistent theme colors like other checkboxes
  • Functionality: Identical behavior, just proper styling

The fix ensures TreeView checkboxes now use the same consistent styling as other checkboxes throughout VS Code, respecting the current theme colors.

Fixes #252638.

Warning

Firewall rules blocked me from connecting to one or more addresses

I tried to connect to the following addresses, but was blocked by firewall rules:

  • electronjs.org
    • Triggering command: node-gyp (dns block)

If you need me to access, download, or install something from one of these locations, you can either:


💡 You can make Copilot smarter by setting up custom instructions, customizing its development environment and configuring Model Context Protocol (MCP) servers. Learn more Copilot coding agent tips in the docs.

@Copilot Copilot AI changed the title [WIP] Have TreeView checkboxes align with rest of custom checkboxes Fix TreeView checkbox styling to align with theme colors Jul 10, 2025
@Copilot Copilot AI requested a review from alexr00 July 10, 2025 10:07
Copilot finished work on behalf of alexr00 July 10, 2025 10:07
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.

Have TreeView checkboxes align with rest of custom checkboxes
2 participants