From f54626ac92562930251e039ace557abde68cbbe1 Mon Sep 17 00:00:00 2001 From: Rich Harris Date: Fri, 28 Dec 2018 17:39:37 -0500 Subject: [PATCH] only remove our own styles --- site/src/routes/repl/_components/Output/Viewer.html | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/site/src/routes/repl/_components/Output/Viewer.html b/site/src/routes/repl/_components/Output/Viewer.html index b7bb73f8ed..ef377b8b3c 100644 --- a/site/src/routes/repl/_components/Output/Viewer.html +++ b/site/src/routes/repl/_components/Output/Viewer.html @@ -123,7 +123,7 @@ const missingImports = bundle.imports.filter(x => !importCache[x]); const removeStyles = () => { - const styles = iframe.contentDocument.querySelectorAll('style'); + const styles = iframe.contentDocument.querySelectorAll('style.svelte'); let i = styles.length; while (i--) styles[i].parentNode.removeChild(styles[i]); }; @@ -161,6 +161,7 @@ if (rendered.css.code) { var style = document.createElement('style'); + style.className = 'svelte'; style.textContent = rendered.css.code; document.head.appendChild(style); }