Decorations: fall back to lower-priority colors#325422
Open
justjavac wants to merge 3 commits into
Open
Conversation
Contributor
There was a problem hiding this comment.
Pull request overview
Adds priority-ordered theme color fallbacks for file decorations.
Changes:
- Generates CSS variable fallback chains for decoration colors.
- Adds a browser test for lower-priority label color fallback.
- Updates icon color handling for computed CSS values.
Reviewed changes
Copilot reviewed 2 out of 2 changed files in this pull request and generated 1 comment.
| File | Description |
|---|---|
decorationsService.ts |
Builds and applies prioritized color fallback chains. |
decorationsService.test.ts |
Tests label color fallback behavior. |
lramos15
approved these changes
Jul 13, 2026
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Fixes #238040
When multiple file decorations apply to the same resource, generate a CSS variable fallback chain in priority order. This preserves a lower-priority decoration color when a higher-priority color is undefined by the active theme, such as
list.errorForegroundin high contrast themes.The fallback chain is also used for decoration badges and icons, so it continues to work when the color theme changes.
Tests:
npm run typecheck-clientnpm run test-browser-no-install -- --run src/vs/workbench/services/decorations/test/browser/decorationsService.test.ts --browser chromiumnpm run eslint -- src/vs/workbench/services/decorations/browser/decorationsService.ts src/vs/workbench/services/decorations/test/browser/decorationsService.test.ts