diff --git a/src/FrontendRuntime.wl b/src/FrontendRuntime.wl index 549089c..f48201b 100644 --- a/src/FrontendRuntime.wl +++ b/src/FrontendRuntime.wl @@ -36,6 +36,10 @@ injectInRuntime[{"Modules", "js"}, data_List] := With[{notebooks = Values[Notebo WebUISubmit[ Global`UIHeadInject["js", data ], #["Socket"] ] &/@ notebooks; ] +injectInRuntime[{"Modules", "css"}, data_List] := With[{notebooks = Values[Notebook`HashMap]}, + WebUISubmit[ Global`UIHeadInject["css", data ], #["Socket"] ] &/@ notebooks; +] + EventHandler[NotebookEditorChannel // EventClone, { "RequestRuntimeExtensions" -> Function[assoc, diff --git a/src/misc.js b/src/misc.js index 7a7a8cf..8353712 100644 --- a/src/misc.js +++ b/src/misc.js @@ -89,6 +89,7 @@ core.UIHeadInject.css = async (args, env) => { data.forEach((el) => { const style = document.createElement('style'); style.textContent = el; + console.log(el); document.head.appendChild(style); }) }