Skip to content

Commit 3a36663

Browse files
committed
graphviz: render the generated SVGs pleasantly in dark mode
The generated SVGs now gain the `graphviz` class, which makes it easier to customize their look via CSS. This is especially important to support for dark mode, as there are other SVGs on the front page that should not receive the same treatment. Signed-off-by: Johannes Schindelin <[email protected]>
1 parent 59e13e3 commit 3a36663

File tree

2 files changed

+5
-0
lines changed

2 files changed

+5
-0
lines changed

assets/js/application.js

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -793,6 +793,7 @@ var Graphviz = {
793793
},
794794
}
795795
const svg = vizInstance.renderSVGElement(x.innerText, options)
796+
svg.classList.add("graphviz")
796797
x.parentNode.insertBefore(svg, x);
797798
x.style.display = 'none'
798799
});

assets/sass/dark-mode.css

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -152,6 +152,10 @@
152152
#l10n-versions-dropdown footer a {
153153
color: #6969dd;
154154
}
155+
156+
svg.graphviz {
157+
filter: invert(67%);
158+
}
155159
}
156160
}
157161

0 commit comments

Comments
 (0)