Skip to content

Commit cec5e10

Browse files
committed
don't use CSS layers (not supported with SVG software)
1 parent dea9674 commit cec5e10

File tree

1 file changed

+4
-6
lines changed

1 file changed

+4
-6
lines changed

model/src/ProtoVoices/RenderSVG.js

Lines changed: 4 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -334,7 +334,7 @@ export const drawGraph = (graph) => (totalWidth) => (scale) => {
334334

335335
// add CSS
336336
let styleElt = document.createElementNS("http://www.w3.org/2000/svg", "style");
337-
let combinedStyles = defaultStyles + "@layer userstyles { " + graph.styles.css + " }";
337+
let combinedStyles = defaultStyles + "\n" + graph.styles.css + "\n" + uiStyles;
338338
styleElt.innerHTML = combinedStyles;
339339
graphContainer.appendChild(styleElt);
340340

@@ -512,8 +512,6 @@ const markers = `<defs>
512512

513513
// default CSS styles for graph elements
514514
const defaultStyles = `
515-
@layer defaults, userstyles, ui
516-
@layer defaults {
517515
text {
518516
font-size: 16px;
519517
}
@@ -525,8 +523,9 @@ const defaultStyles = `
525523
.pv-edge {
526524
stroke: black;
527525
}
528-
}
529-
@layer ui {
526+
`;
527+
528+
const uiStyles = `
530529
.pv-edge.pv-selected, .pv-op-marker.pv-selected {
531530
stroke: rgb(30, 144, 255);
532531
}
@@ -539,7 +538,6 @@ const defaultStyles = `
539538
.pv-selectable {
540539
cursor: pointer;
541540
}
542-
}
543541
`;
544542

545543
// Helper Functions

0 commit comments

Comments
 (0)