@ucd-lib/theme-elements 2.1.3 → 3.0.0

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.
@@ -13,11 +13,6 @@ export function styles() {
13
13
  [hidden] {
14
14
  display: none;
15
15
  }
16
-
17
- .collapse__content {
18
- background-color: var(--collapse-background-color, white);
19
- border-color: var(--collapse-border-color, black);
20
- }
21
16
  `;
22
17
 
23
18
  return [
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@ucd-lib/theme-elements",
3
- "version": "2.1.3",
3
+ "version": "3.0.0",
4
4
  "description": "Custom elements for the UCD brand theme",
5
5
  "main": "index.js",
6
6
  "scripts": {
@@ -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