From 0c98276d324db649c4a15be7859a501588257972 Mon Sep 17 00:00:00 2001 From: s-ol Date: Thu, 13 Jan 2022 18:27:20 +0100 Subject: move everything into client/ --- client/src/ui/css.js | 13 +++++++++++++ 1 file changed, 13 insertions(+) create mode 100644 client/src/ui/css.js (limited to 'client/src/ui/css.js') diff --git a/client/src/ui/css.js b/client/src/ui/css.js new file mode 100644 index 0000000..9089f1e --- /dev/null +++ b/client/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; +}; -- cgit v1.2.3