Skip to content

Commit 6707729

Browse files
committed
(GH-422) Colorize the Node Graph Preview correctly
Previously the Node Graph Feature used hardcoded colors for the graph, expecting a dark theme. This commit adds in CSS coloring to override the generated SVG content and instead ise the VSCode theme coloring. This means the preview will now reflect the correct colors of the users theme, and, also auto-updates as the user browses new themes.
1 parent a7f101c commit 6707729

File tree

1 file changed

+17
-0
lines changed

1 file changed

+17
-0
lines changed

src/feature/NodeGraphFeature.ts

Lines changed: 17 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -105,6 +105,23 @@ class NodeGraphWebViewProvider implements vscode.Disposable {
105105
<head>
106106
<meta charset="UTF-8">
107107
<meta name="viewport" content="width=device-width, initial-scale=1.0">
108+
<style>
109+
g.node path {
110+
fill: var(--vscode-button-background);
111+
stroke: var(--vscode-button-hoverBackground);
112+
}
113+
g.node text {
114+
fill: var(--vscode-button-foreground);
115+
}
116+
g.edge path {
117+
fill: none;
118+
stroke: var(--vscode-foreground);
119+
}
120+
g.edge polygon {
121+
fill: var(--vscode-foreground);
122+
stroke: var(--vscode-foreground);
123+
}
124+
</style>
108125
</head>
109126
<body>
110127
${errorContent}

0 commit comments

Comments
 (0)