loadCSS method

dynamic loadCSS(
  1. String cssFile
)

Add custom CSS code to Editor

Implementation

loadCSS(String cssFile) {
  var jsCSSImport = "(function() {" +
      "    var head  = document.getElementsByTagName(\"head\")[0];" +
      "    var link  = document.createElement(\"link\");" +
      "    link.rel  = \"stylesheet\";" +
      "    link.type = \"text/css\";" +
      "    link.href = \"" +
      cssFile +
      "\";" +
      "    link.media = \"all\";" +
      "    head.appendChild(link);" +
      "}) ();";
  _controller!.evaluateJavascript(source: jsCSSImport);
}