@ucd-lib/theme-elements 2.1.4 → 3.0.1
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/package.json
CHANGED
|
@@ -15,6 +15,19 @@ const MainDomElement = (superClass) => class extends superClass {
|
|
|
15
15
|
* @returns {LitElement}
|
|
16
16
|
*/
|
|
17
17
|
createRenderRoot() {
|
|
18
|
+
// hack for inserting styles into main dom
|
|
19
|
+
let styles = this.constructor.elementStyles || [];
|
|
20
|
+
if( !Array.isArray(styles) ) styles = [styles];
|
|
21
|
+
|
|
22
|
+
for (const s of styles) {
|
|
23
|
+
const style = document.createElement('style');
|
|
24
|
+
const nonce = global['litNonce'];
|
|
25
|
+
if (nonce !== undefined) {
|
|
26
|
+
style.setAttribute('nonce', nonce);
|
|
27
|
+
}
|
|
28
|
+
style.textContent = s.cssText;
|
|
29
|
+
this.appendChild(style);
|
|
30
|
+
}
|
|
18
31
|
return this;
|
|
19
32
|
}
|
|
20
33
|
|