aboutsummaryrefslogtreecommitdiffstats
path: root/src/ui/css.js
diff options
context:
space:
mode:
authors-ol <s-ol@users.noreply.github.com>2021-02-05 18:32:12 +0000
committers-ol <s-ol@users.noreply.github.com>2021-02-05 18:42:02 +0000
commit464174b7e5e4e5c389c896173e8c7ab21badda8a (patch)
tree0f88ffc3db86026f86cb2941e4a05bd8a2753903 /src/ui/css.js
parentlinks leave shadow (diff)
downloadfedidag-464174b7e5e4e5c389c896173e8c7ab21badda8a.tar.gz
fedidag-464174b7e5e4e5c389c896173e8c7ab21badda8a.zip
clean up UI code
Diffstat (limited to 'src/ui/css.js')
-rw-r--r--src/ui/css.js13
1 files changed, 13 insertions, 0 deletions
diff --git a/src/ui/css.js b/src/ui/css.js
new file mode 100644
index 0000000..e793c4f
--- /dev/null
+++ b/src/ui/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;
+};