Modern UI: Fix CSS specificity for tab action fading - #332103
Merged
Lee Murray (mrleemurray) merged 3 commits intoAug 24, 2026
Merged
Modern UI: Fix CSS specificity for tab action fading#332103Lee Murray (mrleemurray) merged 3 commits into
Lee Murray (mrleemurray) merged 3 commits into
Conversation
Contributor
There was a problem hiding this comment.
Pull request overview
Fixes Modern UI tab-action fade colors and directions by correcting CSS specificity.
Changes:
- Moves the default right-side gradient into a direction-specific rule.
- Allows active, unfocused, selected, and left-side rules to override correctly.
💡 Add a code-review agent skill or configure MCP servers for context-aware, tailored reviews. Learn more in the docs.
Comment on lines
+395
to
+397
| .modern-ui-tabs.monaco-workbench:not(:is(.hc-black, .hc-light)) .part.editor > .content .editor-group-container > .title .tabs-container > .tab:not(.tab-actions-left):not(.close-action-off):hover > .tab-actions::before, | ||
| .modern-ui-tabs.monaco-workbench:not(:is(.hc-black, .hc-light)) .part.editor > .content .editor-group-container > .title .tabs-container > .tab:not(.tab-actions-left):not(.close-action-off) > .tab-actions:focus-within::before { | ||
| background-image: linear-gradient(to right, transparent, var(--modern-ui-editor-tab-action-hover-background)); |
Author
There was a problem hiding this comment.
I added tests.
Some cases can not be unit tested, so I appended testing details to the PR description.
Author
|
@microsoft-github-policy-service agree |
Co-authored-by: Copilot Autofix powered by AI <175728472+Copilot@users.noreply.github.com>
Haddy18
reviewed
Aug 22, 2026
Haddy18
left a comment
There was a problem hiding this comment.
Great fix for the CSS specificity issue! The approach of moving to state-specific rules makes sense. Good test coverage too. 🎉
Lee Murray (mrleemurray)
approved these changes
Aug 24, 2026
Aiday Marlen Kyzy (aiday-mar)
approved these changes
Aug 24, 2026
Martin Aeschlimann (aeschli)
approved these changes
Aug 24, 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.
Problem
In Modern UI, the editor tab action fade can use the wrong color or gradient direction in some cases.
This regression was introduced by #331476.
Reproduction
Configure tab actions to overlay the tab label and appear on the left:
{ "workbench.experimental.modernUI": true, "workbench.editor.tabActionLocation": "left", "workbench.editor.tabActionReserveSpace": false, "workbench.colorCustomizations": { "modernEditorTab.activeBackground": "#faa", "modernEditorTab.activeActionBackground": "#f00", "modernEditorTab.activeHoverBackground": "#ffa", "modernEditorTab.activeHoverActionBackground": "#ff0", "modernEditorTab.hoverBackground": "#afa", "modernEditorTab.hoverActionBackground": "#0f0", "tab.selectedBackground": "#aaf", "modernEditorTab.selectedActionBackground": "#00f" } }Hover over or focus the editor tab actions. The fade can have the wrong color or direction.



Fix
The right-side fade previously assigned
modernEditorTab.hoverActionBackgroundin a rule with higher specificity than the corresponding rules for other tab states and directions.Move the default right-side background declaration into a state-specific rule with matching specificity. This allows the active, unfocused, and left-side fade rules to override it correctly.
Test
Added unit tests for consistency of tab action background colors, fade colors, and fade directions across different tab states and locations.
Test Coverage:
Why active hover states are not unit tested:
The
modernEditorTab.activeHoverActionBackgroundcases require a:hoverCSS pseudo-state, which cannot be reliably simulated in unit tests. These states must be verified manually.Manual Testing Steps:
To verify the active hover states work correctly, hover over the active tab in the following scenarios:
Use the reproduction configuration from the PR description to verify the fade gradient has the correct color and direction in each case.