aboutsummaryrefslogtreecommitdiff
path: root/css.js
blob: 9dbf4b0f2873c4cb0fd43f421ff874a314872d0e (plain)
1
2
3
4
5
6
7
8
9
10
11
12
async function load_sheet(url) {
	const response = await fetch(url);
	const content = await response.text();
	const sheet = new CSSStyleSheet();
	await sheet.replace(content);
	return sheet;
}

export async function css(base, ...urls) {
	return await Promise.all(urls.map(url => load_sheet(new URL(url, base))))
}