aboutsummaryrefslogtreecommitdiffstats
path: root/app/css.js
diff options
context:
space:
mode:
authors-ol <s-ol@users.noreply.github.com>2020-10-04 12:19:25 +0000
committers-ol <s-ol@users.noreply.github.com>2020-10-04 12:19:25 +0000
commit1ab9ed5b297048c5d3bc0278eddeb5a1d1c80367 (patch)
tree929cd8dd9eaa99894e4f7da9b2ad0f6e5be1abd6 /app/css.js
downloadisomorphic-kb-explorer-1ab9ed5b297048c5d3bc0278eddeb5a1d1c80367.tar.gz
isomorphic-kb-explorer-1ab9ed5b297048c5d3bc0278eddeb5a1d1c80367.zip
initial commit
Diffstat (limited to 'app/css.js')
-rw-r--r--app/css.js13
1 files changed, 13 insertions, 0 deletions
diff --git a/app/css.js b/app/css.js
new file mode 100644
index 0000000..842214a
--- /dev/null
+++ b/app/css.js
@@ -0,0 +1,13 @@
+export default (code) => {
+ const style = document.createElement('style');
+ document.head.appendChild(style);
+ style.appendChild(document.createTextNode(''));
+
+ let i = 0;
+ for (const v of code.split('}')) {
+ if (v.indexOf('{') < 0) continue;
+ style.sheet.insertRule(v + '}', i++);
+ }
+
+ return style;
+};