-
Notifications
You must be signed in to change notification settings - Fork 30.3k
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
Debt - use CSS variables over registerThemingParticipant
#165169
Comments
I looked over mine again and they are all there still intentionally: vscode/src/vs/workbench/contrib/terminal/browser/widgets/terminalHoverWidget.ts Lines 135 to 143 in bceaaf8
I don't think we can get the same effect of Same as above. vscode/src/vs/workbench/contrib/terminal/browser/xterm/decorationAddon.ts Lines 479 to 486 in bceaaf8
This is needed as the color is handed off to xterm.js. |
@Tyriar please check those occurrences anyways so that we can remove them from the todo list |
For For vscode/src/vs/workbench/contrib/search/browser/searchView.ts Lines 2037 to 2045 in b58d49d
|
@andreamah you're setting |
The element also has links, which have a normal alpha, so then the link opacity is affected. |
@andreamah you could have another rule with higher specificity that re-applies the link color? |
@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 editorHoverHighlightColor
vscode/src/vs/workbench/contrib/terminal/browser/xterm/decorationAddon.ts Lines 479 to 486 in bceaaf8
To access a color value use IThemeService.getColorTheme().getColor(...)
|
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 |
Closing this as I believe we are done here |
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--vscode-
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.ts
@rebornixsrc/vs/workbench/browser/parts/activitybar/activitybarActions.ts
src/vs/workbench/browser/parts/editor/tabsTitleControl.ts
@bpaserosrc/vs/workbench/contrib/codeEditor/browser/find/simpleFindWidget.ts
@Tyriarsrc/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.ts
@roblourenssrc/vs/workbench/contrib/debug/browser/callStackEditorContribution.ts
@roblourenssrc/vs/workbench/contrib/debug/browser/debugColors.ts
@roblourenssrc/vs/workbench/contrib/extensions/browser/extensionsActions.ts
@sandy081src/vs/workbench/contrib/extensions/browser/extensionsList.ts
@sandy081src/vs/workbench/contrib/extensions/browser/extensionsViewer.ts
@sandy081src/vs/workbench/contrib/extensions/browser/extensionsWidgets.ts
@sandy081src/vs/workbench/contrib/interactive/browser/interactive.contribution.ts
@rebornixsrc/vs/workbench/contrib/output/browser/outputView.ts
@sandy081src/vs/workbench/contrib/search/browser/searchView.ts
@andreamahsrc/vs/workbench/contrib/searchEditor/browser/searchEditor.ts
@andreamahsrc/vs/workbench/contrib/terminal/browser/terminalInstance.ts
@Tyriarsrc/vs/workbench/contrib/terminal/browser/terminalView.ts
@Tyriarsrc/vs/workbench/contrib/terminal/browser/widgets/terminalHoverWidget.ts
@Tyriarsrc/vs/workbench/contrib/terminal/browser/xterm/decorationAddon.ts
@Tyriarsrc/vs/workbench/contrib/terminal/browser/xterm/markNavigationAddon.ts
@Tyriarsrc/vs/workbench/contrib/terminal/browser/xterm/quickFixAddon.ts
@Tyriarsrc/vs/workbench/contrib/welcomeOverlay/browser/welcomeOverlay.ts
@bhavyaussrc/vs/workbench/contrib/welcomeWalkthrough/browser/walkThroughPart.ts
@bhavyausThe text was updated successfully, but these errors were encountered: