Repository navigation
Closed
Description
When running VS Code (or the Monaco editor) all theme colors are exposed as CSS variables. That means components don’t need to use JavaScript to read and set colors but can simply rely on CSS. When a theme changes, the variable values automatically update. Also, with CSS variables you have less code and everything in one place.
The (long) list below is all users of registerThemingParticipant. Those that only set/update colors are candidates for adopting CSS variables The names of the CSS variables can be "derived" with the following logic
- prefix
--vscode- - take the theme color id and replace dots with slashes
For instance the color id editorSuggestWidget.background is exposed as CSS variables --vscode-editorSuggestWidget-background. Find a sample adoption in this commit: 3a787a8.
-
src/vs/editor/contrib/find/browser/findWidget.tsPeng Lyu (@rebornix) -
src/vs/workbench/browser/parts/activitybar/activitybarActions.ts -
src/vs/workbench/browser/parts/editor/tabsTitleControl.tsBenjamin Pasero (@bpasero) -
src/vs/workbench/contrib/codeEditor/browser/find/simpleFindWidget.tsDaniel Imms (@Tyriar) -
src/vs/workbench/contrib/codeEditor/browser/suggestEnabledInput/suggestEnabledInput.ts -
src/vs/workbench/contrib/codeEditor/browser/untitledTextEditorHint.ts -
src/vs/workbench/contrib/customEditor/browser/customEditors.ts -
src/vs/workbench/contrib/debug/browser/breakpointEditorContribution.tsroblourens -
src/vs/workbench/contrib/debug/browser/callStackEditorContribution.tsroblourens -
src/vs/workbench/contrib/debug/browser/debugColors.tsroblourens -
src/vs/workbench/contrib/extensions/browser/extensionsActions.tsSandeep Somavarapu (@sandy081) -
src/vs/workbench/contrib/extensions/browser/extensionsList.tsSandeep Somavarapu (@sandy081) -
src/vs/workbench/contrib/extensions/browser/extensionsViewer.tsSandeep Somavarapu (@sandy081) -
src/vs/workbench/contrib/extensions/browser/extensionsWidgets.tsSandeep Somavarapu (@sandy081) -
src/vs/workbench/contrib/interactive/browser/interactive.contribution.tsPeng Lyu (@rebornix) -
src/vs/workbench/contrib/output/browser/outputView.tsSandeep Somavarapu (@sandy081) -
src/vs/workbench/contrib/search/browser/searchView.tsAndrea Mah (@andreamah) -
src/vs/workbench/contrib/searchEditor/browser/searchEditor.tsAndrea Mah (@andreamah) -
src/vs/workbench/contrib/terminal/browser/terminalInstance.tsDaniel Imms (@Tyriar) -
src/vs/workbench/contrib/terminal/browser/terminalView.tsDaniel Imms (@Tyriar) -
src/vs/workbench/contrib/terminal/browser/widgets/terminalHoverWidget.tsDaniel Imms (@Tyriar) -
src/vs/workbench/contrib/terminal/browser/xterm/decorationAddon.tsDaniel Imms (@Tyriar) -
src/vs/workbench/contrib/terminal/browser/xterm/markNavigationAddon.tsDaniel Imms (@Tyriar) -
src/vs/workbench/contrib/terminal/browser/xterm/quickFixAddon.tsDaniel Imms (@Tyriar) -
src/vs/workbench/contrib/welcomeOverlay/browser/welcomeOverlay.tsBhavya U (@bhavyaus) -
src/vs/workbench/contrib/welcomeWalkthrough/browser/walkThroughPart.tsBhavya U (@bhavyaus)
Reacted by Raymond Zhao and Gaurav Bhagchandani
Activity
121 remaining items
Tyriar commentedon Feb 27, 2023
Andrea Mah (@andreamah) you could have another rule with higher specificity that re-applies the link color?
aeschli commentedon Feb 28, 2023
Daniel Imms (@Tyriar) For
vscode/src/vs/workbench/contrib/terminal/browser/widgets/terminalHoverWidget.ts
Lines 135 to 143 in bceaaf8
you could define a new (terminal hover specific) color. The default value of the color can express that it is a function of
editorHoverHighlightColorvscode/src/vs/workbench/contrib/terminal/browser/xterm/decorationAddon.ts
Lines 479 to 486 in bceaaf8
To access a color value use
IThemeService.getColorTheme().getColor(...)bpasero commentedon Feb 28, 2023
As discussed in standup, tabs have quite an involved CSS ruling that involves not only colors but also other properties. I would like to keep it this way via
registerThemingParticipantand not invent various class names to get a similar effect to make maintenance easier there.Use decoration colors directly
Register a new color instead of theme participant
jrieken commentedon May 9, 2023
Closing this as I believe we are done here