Skip to content

Conversation

@shivank-1011
Copy link

Summary

Add hover-specific theme tokens for the Activity Bar and wire them into the Activity Bar CSS so hover foreground/background can be customized separately from the normal foreground.

Files changed

  • src/vs/workbench/common/theme.ts — new color registrations:
    • activityBar.hoverForeground
    • activityBar.hoverBackground
    • activityBarTop.hoverForeground
    • activityBarTop.hoverBackground
  • src/vs/workbench/browser/parts/activitybar/media/activityaction.css — split active/focus/hover selectors so hover uses new CSS vars:
    • --vscode-activityBar-hoverForeground
    • --vscode-activityBar-hoverBackground
    • top/bottom variants use --vscode-activityBarTop-*
  • src/vs/workbench/services/themes/common/workbenchThemeService.ts — add defaults for built-in dark/light theme color maps:
    • activityBar.hoverForeground: #00a0df
    • activityBar.hoverBackground: #a4dcf3
  • src/vs/workbench/services/themes/test/node/colorRegistrySmoke.test.ts — new smoke test asserting the four tokens are registered and exported.
  • build/lib/stylelint/vscode-known-variables.json — register new CSS variables for stylelint/hygiene.

Motivation

Previously hover used activityBar.foreground, which could produce unreadable white-on-white combinations for certain custom color sets. These new tokens allow themes and users to set hover-specific colors, e.g.:
"workbench.colorCustomizations": {
"activityBar.hoverForeground": "#00a0df",
"activityBar.hoverBackground": "#a4dcf3",
"activityBarTop.hoverForeground": "#00a0df",
"activityBarTop.hoverBackground": "#a4dcf3"
}

Tests & verification

  • Added colorRegistrySmoke.test.ts ensuring the four color identifiers are exported and equal the expected ids.
  • Ran strict compile (npm run tsec-compile-check) and test script (./scripts/test.sh) locally — both completed successfully.
  • Performed local build and ran the dev workbench to visually verify hover behavior.

Notes

  • I added new variables to build/lib/stylelint/vscode-known-variables.json to satisfy stylelint/hygiene.
  • Accessibility: high-contrast fallbacks for the new tokens are currently null. We can add hcDark/hcLight defaults if desired.
  • If you want subtler hover backgrounds on dark themes I can change the dark default to a semi-transparent value (e.g. '#a4dcf320').

Copilot AI review requested due to automatic review settings November 8, 2025 10:54
@vs-code-engineering
Copy link

vs-code-engineering bot commented Nov 8, 2025

📬 CODENOTIFY

The following users are being notified based on files changed in this PR:

@bpasero

Matched files:

  • src/vs/workbench/browser/parts/activitybar/media/activityaction.css
  • src/vs/workbench/common/theme.ts

@shivank-1011
Copy link
Author

@microsoft-github-policy-service agree

Copy link
Contributor

Copilot AI left a comment

Choose a reason for hiding this comment

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

Pull Request Overview

This PR adds hover color tokens for the Activity Bar to allow themes to customize foreground and background colors when hovering over activity bar items. These tokens are registered, added to initial theme colors, declared in the smoke test, and utilized in CSS with fallback chains.

  • Registers four new color tokens: activityBar.hoverForeground, activityBar.hoverBackground, activityBarTop.hoverForeground, and activityBarTop.hoverBackground
  • Updates CSS to use the new hover tokens with appropriate fallback chains
  • Adds initial color values for dark and light themes

Reviewed Changes

Copilot reviewed 5 out of 5 changed files in this pull request and generated 3 comments.

Show a summary per file
File Description
src/vs/workbench/common/theme.ts Registers four new activity bar hover color tokens
src/vs/workbench/services/themes/common/workbenchThemeService.ts Adds initial hover colors for dark and light themes
src/vs/workbench/browser/parts/activitybar/media/activityaction.css Updates hover styles to use new color tokens with fallback chains
build/lib/stylelint/vscode-known-variables.json Declares new CSS variables for stylelint validation
src/vs/workbench/services/themes/test/node/colorRegistrySmoke.test.ts Adds smoke test to verify the hover tokens are registered

shivank-1011 and others added 2 commits November 8, 2025 16:41
Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com>
Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com>
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.

3 participants