@pionjs/pion
Version:
Hooks for web components
13 lines (12 loc) • 415 B
JavaScript
export const sheet = (...styles) => {
const cs = new CSSStyleSheet();
cs.replaceSync(styles.join(""));
return cs;
};
export const sheets = (styleSheets) => styleSheets?.map((style) => {
if (typeof style === "string")
return sheet(style);
return style;
});
export const tagged = (strings, ...values) => strings.flatMap((s, i) => [s, values[i] || ""]).join("");
export const css = tagged;