Skip to content

Commit afced09

Browse files
moves default renderer stylesheet to styles.css (#85) and add text-output styles (#86)
1 parent 0e99c59 commit afced09

File tree

3 files changed

+11
-10
lines changed

3 files changed

+11
-10
lines changed

src/renderer/dataSummaryRenderer.ts

Lines changed: 2 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@ import type {
33
RendererContext
44
} from 'vscode-notebook-renderer';
55
import {OutputLoader} from './outputLoader';
6-
import './style.css';
6+
import './styles.css';
77
const htl = require('htl');
88
const inputs = require('@observablehq/inputs');
99
const dataSummary = require('./dataSummaryView.js');
@@ -44,10 +44,7 @@ export function render(output: IRenderInfo) {
4444
}
4545
else {
4646
// output text in pre/code tags
47-
output.container.appendChild(htl.html`<pre
48-
style="max-height: 300px; white-space: pre-wrap; tab-size: 2; overflow: auto;">
49-
<code style="display: block; white-space: pre-wrap;">${data}</code>
50-
</pre>`);
47+
output.container.appendChild(htl.html`<pre class="text-output"><code>${data}</code></pre>`);
5148
}
5249
}
5350

src/renderer/dataTableRenderer.ts

Lines changed: 2 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@ import type {
33
RendererContext
44
} from 'vscode-notebook-renderer';
55
import { OutputLoader } from './outputLoader';
6-
import './style.css';
6+
import './styles.css';
77
const htl = require('htl');
88
const inputs = require('@observablehq/inputs');
99

@@ -48,10 +48,7 @@ export function render(output: IRenderInfo) {
4848
}
4949
else {
5050
// output text in pre/code tags
51-
output.container.appendChild(htl.html`<pre
52-
style="max-height: 300px; white-space: pre-wrap; tab-size: 2; overflow: auto;">
53-
<code style="display: block; white-space: pre-wrap;">${data}</code>
54-
</pre>`);
51+
output.container.appendChild(htl.html`<pre class="text-output"><code>${data}</code></pre>`);
5552
}
5653
}
5754

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,10 @@
1+
.text-output {
2+
max-height: 360px;
3+
overflow: auto;
4+
tab-size: 2;
5+
white-space: pre-wrap;
6+
}
7+
18
.data-table {
29
max-width: 100%;
310
background-color: var(--vscode-editor-background);

0 commit comments

Comments
 (0)