Skip to content

Commit 9ee944c

Browse files
#161 added theme color override for custom themes
+ set grid padding to 2px + larger grid scrollbars (18px)
1 parent 04b565d commit 9ee944c

File tree

2 files changed

+19
-4
lines changed

2 files changed

+19
-4
lines changed

src/data.preview.ts

Lines changed: 15 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -179,7 +179,7 @@ export class DataPreview {
179179
scripts: scriptsPath,
180180
styles: stylesPath,
181181
theme: this.theme,
182-
themeColor: (this.theme === 'material') ? '#eee' : '#2f3136', // light/dark themes viewer background color
182+
themeColor: this.themeColor,
183183
charts: this._charts
184184
});
185185

@@ -829,6 +829,20 @@ export class DataPreview {
829829
return dataViewTheme;
830830
}
831831

832+
/**
833+
* Gets UI theme color for the Data View dropdowns background color override.
834+
*/
835+
get themeColor(): string {
836+
let themeColor: string = '#eee'; // default light theme color
837+
if (this.theme.endsWith('.dark')) {
838+
themeColor = '#2f3136';
839+
}
840+
else {
841+
themeColor = 'none'; // for the custom themes
842+
}
843+
return themeColor;
844+
}
845+
832846
/**
833847
* Gets charts plugin preference for Data Preview display from workspace config.
834848
* see package.json 'configuration' section for more info.

templates/data.view.html

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -98,10 +98,11 @@
9898
background-color: var(--vscode-editor-background);
9999
}
100100
perspective-viewer {
101-
--select--color: var(--vscode-editor-foreground);
102-
--select--background-color: var(--vscode-editor-background);
101+
/* --select--color: var(--vscode-editor-foreground); */
102+
/* --select--background-color: var(--vscode-editor-background); */
103103
--select--padding: 0px 5px 0px 5px;
104-
--hypergrid-scrollbar--width: 12px;
104+
--hypergrid--padding: 2px;
105+
--hypergrid-scrollbar--width: 18px;
105106
--hypergrid-scrollbar--border-radius: 0px;
106107
}
107108
</style>

0 commit comments

Comments
 (0)