Skip to content

Commit 465e95f

Browse files
committed
feat: use VS Code hover widget colors for tooltip backgrounds
Switch timeline and data grid tooltips from generic editor/widget background colors to the more specific editorHoverWidget theme variables, improving visual consistency with VS Code's native
1 parent fb4587b commit 465e95f

4 files changed

Lines changed: 35 additions & 19 deletions

File tree

log-viewer/src/features/timeline/components/TimelineView.ts

Lines changed: 14 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -89,6 +89,20 @@ export class TimelineView extends LitElement {
8989
--tl-widget-border: var(--vscode-editorWidget-border, #454545);
9090
--tl-widget-foreground: var(--vscode-editorWidget-foreground, #cccccc);
9191
92+
/* Hover/tooltip */
93+
--tl-hover-background: var(
94+
--vscode-editorHoverWidget-background,
95+
var(--vscode-editorWidget-background, #252526)
96+
);
97+
--tl-hover-border: var(
98+
--vscode-editorHoverWidget-border,
99+
var(--vscode-editorWidget-border, #454545)
100+
);
101+
--tl-hover-foreground: var(
102+
--vscode-editorHoverWidget-foreground,
103+
var(--vscode-editorWidget-foreground, #cccccc)
104+
);
105+
92106
/* Text */
93107
--tl-description-foreground: var(--vscode-descriptionForeground, #999);
94108
--tl-font-family: var(--vscode-font-family, sans-serif);

log-viewer/src/features/timeline/optimised/rendering/tooltip-utils.ts

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -39,11 +39,11 @@ export const PERCENT_THRESHOLD_BREACH = 1.0;
3939
*/
4040
export const TOOLTIP_CSS = {
4141
/** Background color */
42-
background: 'var(--tl-widget-background, #252526)',
42+
background: 'var(--tl-hover-background, #252526)',
4343
/** Border color */
44-
border: 'var(--tl-widget-border, #454545)',
44+
border: 'var(--tl-hover-border, #454545)',
4545
/** Text color */
46-
foreground: 'var(--tl-widget-foreground, #e3e3e3)',
46+
foreground: 'var(--tl-hover-foreground, #e3e3e3)',
4747
/** Description/secondary text color */
4848
descriptionForeground: 'var(--tl-description-foreground, #999)',
4949
/** Muted description text color */

log-viewer/src/features/timeline/styles/timeline.css.ts

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -18,8 +18,8 @@ export const tooltipStyles = `
1818
padding: 5px;
1919
border-radius: 4px;
2020
border-left: 4px solid;
21-
background-color: var(--tl-editor-background);
22-
color: var(--tl-editor-foreground);
21+
background-color: var(--tl-hover-background);
22+
color: var(--tl-hover-foreground);
2323
font-family: monospace;
2424
font-size: 0.92rem;
2525
pointer-events: auto;
@@ -47,16 +47,16 @@ export const tooltipStyles = `
4747
white-space: nowrap;
4848
text-overflow: ellipsis;
4949
padding-right: 12px;
50+
color: var(--tl-description-foreground, #999);
51+
opacity: 0.9;
5052
}
5153
5254
.tooltip-value {
5355
flex-shrink: 0;
5456
font-variant-numeric: tabular-nums;
5557
font-weight: 500;
5658
font-family: monospace;
57-
opacity: 0.9;
5859
text-align: right;
5960
white-space: pre-wrap;
60-
color: var(--tl-description-foreground, #999)
6161
}
6262
`;

log-viewer/src/tabulator/style/DataGrid.scss

Lines changed: 14 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -38,6 +38,7 @@ $footerTextColor: var(--vscode-editor-foreground); //footer text color
3838
$footerBorderColor: transparent; //footer border color
3939
$footerSeparatorColor: transparent; //footer bottom separator color
4040
$footerActiveColor: #d00 !default; //footer bottom active text color
41+
4142
@import '~tabulator-tables/src/scss/tabulator.scss';
4243
@import '../editors/MinMax';
4344
@import '../format/Progress';
@@ -102,18 +103,6 @@ $footerActiveColor: #d00 !default; //footer bottom active text color
102103
font-size: var(--vscode-editor-font-size, 0.9em);
103104
}
104105

105-
.tabulator-tooltip {
106-
// Match timeline tooltip styling for consistency
107-
background: var(--vscode-editor-background);
108-
color: var(--vscode-editor-foreground);
109-
overflow-wrap: anywhere;
110-
font-family: monospace;
111-
font-size: 0.92rem;
112-
font-variant-numeric: tabular-nums;
113-
padding: 5px;
114-
border-radius: 4px;
115-
box-shadow: 0 8px 24px rgba(0, 0, 0, 0.5);
116-
}
117106
.tabulator-row.tabulator-selected {
118107
color: var(--vscode-list-activeSelectionForeground);
119108
}
@@ -155,6 +144,19 @@ $footerActiveColor: #d00 !default; //footer bottom active text color
155144
}
156145
}
157146

147+
.tabulator-tooltip {
148+
// Match timeline tooltip styling for consistency
149+
background: var(--vscode-editorHoverWidget-background, var(--vscode-editorWidget-background));
150+
color: var(--vscode-editorHoverWidget-foreground, var(--vscode-editor-foreground));
151+
overflow-wrap: anywhere;
152+
font-family: monospace;
153+
font-size: 0.92rem;
154+
font-variant-numeric: tabular-nums;
155+
padding: 5px;
156+
border-radius: 4px;
157+
box-shadow: 0 8px 24px rgba(0, 0, 0, 0.5);
158+
}
159+
158160
.tabulator-edit-list {
159161
border-color: var(--vscode-focusBorder, default);
160162

0 commit comments

Comments
 (0)