@symbiotejs/symbiote
Version:
Symbiote.js - close-to-platform frontend library for building super-powered web components
11 lines • 326 B
JavaScript
/** @param {String | CSSStyleSheet} styles */
export function prepareStyleSheet(styles) {
let styleSheet;
if (styles.constructor === CSSStyleSheet) {
styleSheet = styles;
} else if (styles.constructor === String) {
styleSheet = new CSSStyleSheet();
styleSheet.replaceSync(styles);
}
return styleSheet;
}