Improve tabe markdown css (#5093)

This commit is contained in:
Chris LaFreniere
2019-04-18 14:57:26 -07:00
committed by GitHub
parent 31f7364f08
commit 7ce921d449
2 changed files with 44 additions and 2 deletions

View File

@@ -15,4 +15,36 @@ text-cell-component .notebook-preview {
.notebook-preview.actionselect {
user-select: text;
}
}
text-cell-component table {
border-collapse: collapse;
border-spacing: 0;
border: none;
font-size: 12px;
table-layout: auto;
margin-left: auto;
margin-right: auto;
margin-bottom: 1em;
display: table-row;
}
text-cell-component thead {
vertical-align: bottom;
}
text-cell-component td,
text-cell-component th,
text-cell-component tr {
text-align: left;
vertical-align: middle;
padding: 0.5em 0.5em;
line-height: normal;
white-space: normal;
max-width: none;
border: none;
}
text-cell-component th {
font-weight: bold;
}

View File

@@ -6,7 +6,7 @@ import 'vs/css!./notebook';
import { registerThemingParticipant, ITheme, ICssStyleCollector } from 'vs/platform/theme/common/themeService';
import { SIDE_BAR_BACKGROUND, SIDE_BAR_SECTION_HEADER_BACKGROUND, EDITOR_GROUP_HEADER_TABS_BACKGROUND } from 'vs/workbench/common/theme';
import { activeContrastBorder, contrastBorder, buttonBackground, textLinkForeground, editorBackground } from 'vs/platform/theme/common/colorRegistry';
import { activeContrastBorder, contrastBorder, buttonBackground, textLinkForeground } from 'vs/platform/theme/common/colorRegistry';
import { IDisposable } from 'vscode-xterm';
import { editorLineHighlight, editorLineHighlightBorder } from 'vs/editor/common/view/editorColorRegistry';
@@ -185,5 +185,15 @@ export function registerNotebookThemes(overrideEditorThemeSetting: boolean): IDi
}
`);
}
// Styling for tables in notebooks
const borderColor = theme.getColor(SIDE_BAR_BACKGROUND);
if (borderColor) {
collector.addRule(`
.notebookEditor text-cell-component tbody tr:nth-child(odd) {
background: ${borderColor};
}
`);
}
});
}