aboutsummaryrefslogtreecommitdiffstats
path: root/src/ui/css.js
blob: e793c4fecbb65ae18e4d9f582ac7406f5b846ea7 (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;
};