imp: properly inject css in iframe, as expected

This commit is contained in:
Géry Debongnie
2019-03-29 13:06:57 +01:00
parent 4be15febb9
commit 2cabdf8d5c
2 changed files with 6 additions and 8 deletions
+3 -5
View File
@@ -74,11 +74,9 @@ class Playground extends Component {
doc.body.appendChild(script);
// inject css
const link = document.createElement("link");
link.type = "text/css";
link.rel = "stylesheet";
link.innerHTML = this.state.css;
doc.body.appendChild(link);
const style = document.createElement("style");
style.innerHTML = this.state.css;
doc.head.appendChild(style);
};
this.refs.content.innerHTML = "";