aboutsummaryrefslogtreecommitdiffstats
path: root/client/src/ui/css.js
blob: 9089f1e1df1c2ea97ac89a2bb99dc14ce0301a4b (plain)
1
2
3
4
5
6
7
8
9
10
11
12
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;
};