diff options
| author | s-ol <s-ol@users.noreply.github.com> | 2020-10-04 12:19:25 +0000 |
|---|---|---|
| committer | s-ol <s-ol@users.noreply.github.com> | 2020-10-04 12:19:25 +0000 |
| commit | 1ab9ed5b297048c5d3bc0278eddeb5a1d1c80367 (patch) | |
| tree | 929cd8dd9eaa99894e4f7da9b2ad0f6e5be1abd6 /app/css.js | |
| download | isomorphic-kb-explorer-1ab9ed5b297048c5d3bc0278eddeb5a1d1c80367.tar.gz isomorphic-kb-explorer-1ab9ed5b297048c5d3bc0278eddeb5a1d1c80367.zip | |
initial commit
Diffstat (limited to 'app/css.js')
| -rw-r--r-- | app/css.js | 13 |
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; +}; |
