Skip to content

Commit

Permalink
fix
Browse files Browse the repository at this point in the history
  • Loading branch information
stereobooster committed Feb 15, 2025
1 parent d395b21 commit 11144ff
Showing 1 changed file with 6 additions and 3 deletions.
9 changes: 6 additions & 3 deletions packages/docs/src/components/d2.ts
Original file line number Diff line number Diff line change
Expand Up @@ -17,9 +17,12 @@ document.querySelectorAll(".d2.shadow").forEach(async (container: Element) => {
);
container = iframe.contentDocument!.querySelector("svg")! as Element;
const styleSheet = iframe.contentDocument!.styleSheets[0];
css
.split("\n")
.forEach((row) => styleSheet.insertRule(row, styleSheet.cssRules.length));
if (styleSheet)
css
.split("\n")
.forEach((row) =>
styleSheet.insertRule(row, styleSheet.cssRules.length)
);
}

if (!data) return;
Expand Down

0 comments on commit 11144ff

Please sign in to comment.