Skip to content

Commit

Permalink
notebooks: restore --theme colors for notebook webviews
Browse files Browse the repository at this point in the history
  • Loading branch information
connor4312 committed Jun 15, 2021
1 parent ad4e5ec commit 79d338b
Show file tree
Hide file tree
Showing 2 changed files with 16 additions and 15 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -73,9 +73,10 @@ const constants: Readonly<WebviewStyles> = {
* Transforms base vscode theme variables into generic variables for notebook
* renderers.
* @see https://github.com/microsoft/vscode/issues/107985 for context
* @deprecated
*/
export const transformWebviewThemeVars = (s: Readonly<WebviewStyles>): WebviewStyles => {
const result = { ...constants };
const result = { ...s, ...constants };
for (const [target, src] of mapping) {
result[target] = s[src];
}
Expand Down
28 changes: 14 additions & 14 deletions src/vs/workbench/contrib/webview/browser/pre/main.js
Original file line number Diff line number Diff line change
Expand Up @@ -87,10 +87,10 @@ defaultStyles.textContent = `
body {
background-color: transparent;
color: var(--vscode-editor-foreground, var(--theme-foreground));
font-family: var(--vscode-font-family, var(--theme-font-family));
font-weight: var(--vscode-font-weight, var(--theme-font-weight));
font-size: var(--vscode-font-size, var(--theme-font-size));
color: var(--vscode-editor-foreground);
font-family: var(--vscode-font-family);
font-weight: var(--vscode-font-weight);
font-size: var(--vscode-font-size);
margin: 0;
padding: 0 20px;
}
Expand All @@ -101,11 +101,11 @@ defaultStyles.textContent = `
}
a {
color: var(--vscode-textLink-foreground, var(--theme-link));
color: var(--vscode-textLink-foreground);
}
a:hover {
color: var(--vscode-textLink-activeForeground, var(--theme-link-active));
color: var(--vscode-textLink-activeForeground);
}
a:focus,
Expand All @@ -117,16 +117,16 @@ defaultStyles.textContent = `
}
code {
color: var(--vscode-textPreformat-foreground, var(--theme-code-foreground));
color: var(--vscode-textPreformat-foreground);
}
blockquote {
background: var(--vscode-textBlockQuote-background, var(--theme-quote-background));
border-color: var(--vscode-textBlockQuote-border, var(--theme-quote-border));
background: var(--vscode-textBlockQuote-background);
border-color: var(--vscode-textBlockQuote-border);
}
kbd {
color: var(--vscode-editor-foreground, var(--theme-foreground));
color: var(--vscode-editor-foreground);
border-radius: 3px;
vertical-align: middle;
padding: 1px 3px;
Expand All @@ -149,17 +149,17 @@ defaultStyles.textContent = `
}
::-webkit-scrollbar-corner {
background-color: var(--vscode-editor-background, var(--theme-background));
background-color: var(--vscode-editor-background);
}
::-webkit-scrollbar-thumb {
background-color: var(--vscode-scrollbarSlider-background, var(--theme-scrollbar-background));
background-color: var(--vscode-scrollbarSlider-background);
}
::-webkit-scrollbar-thumb:hover {
background-color: var(--vscode-scrollbarSlider-hoverBackground, var(--theme-scrollbar-hover-background));
background-color: var(--vscode-scrollbarSlider-hoverBackground);
}
::-webkit-scrollbar-thumb:active {
background-color: var(--vscode-scrollbarSlider-activeBackground, var(--theme-scrollbar-active-background));
background-color: var(--vscode-scrollbarSlider-activeBackground);
}`;

/**
Expand Down

0 comments on commit 79d338b

Please sign in to comment.