8000 Fix bug: HTML view shows weird background color in vscode insider (#282) · Netoperz/vscode-arduino@1f74a6c · GitHub
[go: up one dir, main page]

Skip to content

Commit 1f74a6c

Browse files
Fix bug: HTML view shows weird background color in vscode insider (microsoft#282)
* Fix bug: HTML view shows weird background color in vscode insider * Add default theme color for HTML view
1 parent 22da655 commit 1f74a6c

File tree

1 file changed

+6
-6
lines changed

1 file changed

+6
-6
lines changed

src/arduino/arduinoContentProvider.ts

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -78,13 +78,13 @@ export class ArduinoContentProvider implements vscode.TextDocumentContentProvide
7878
console.log('reloaded results window at time ${timeNow}ms');
7979
var doc = document.documentElement;
8080
var styles = window.getComputedStyle(doc);
81-
var backgroundcolor = styles.getPropertyValue('--background-color');
82-
var color = styles.getPropertyValue('--color');
83-
var theme = document.body.className;
81+
var backgroundcolor = styles.getPropertyValue('--background-color') || '#1e1e1e';
82+
var color = styles.getPropertyValue('--color') || '#d4d4d4';
83+
var theme = document.body.className || 'vscode-dark';
8484
var url = "${this._webserver.getEndpointUri(type)}?" +
85-
"theme=" + theme +
86-
"&backgroundcolor=" + backgroundcolor +
87-
"&color=" + color;
85+
"theme=" + encodeURIComponent(theme.trim()) +
86+
"&backgroundcolor=" + encodeURIComponent(backgroundcolor.trim()) +
87+
"&color=" + encodeURIComponent(color.trim());
8888
document.getElementById('frame').src = url;
8989
};
9090
</script>

0 commit comments

Comments
 (0)
0