@descope/web-components-ui 2.1.16 → 2.1.17

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/dist/index.esm.js CHANGED
@@ -407,6 +407,10 @@ const injectStyle = (cssString, ref, { prepend = false } = {}) => {
407
407
  _ref.adoptedStyleSheets = adoptedStyleSheets;
408
408
  }
409
409
 
410
+ if(cssString && !style.cssRules[0]?.style){
411
+ console.warn(`No style rules were created, make sure the CSS is valid:\n "${cssString}"`);
412
+ }
413
+
410
414
  return style;
411
415
  };
412
416
 
@@ -1316,7 +1320,7 @@ const createStyleMixin$1 =
1316
1320
  if (elementId) {
1317
1321
  // basically this is enough to make the selector more specific
1318
1322
  // but just in case there is no id, we will also add the class multiple times
1319
- classSpecifier += `#${elementId}`;
1323
+ classSpecifier += `#${CSS.escape(elementId)}`;
1320
1324
  }
1321
1325
 
1322
1326
  this.#overrideStyleEle = injectStyle(`:host(${classSpecifier}) {}`, this.#rootElement);
@@ -1324,7 +1328,7 @@ const createStyleMixin$1 =
1324
1328
  }
1325
1329
 
1326
1330
  #setAttrOverride(attrName, value) {
1327
- const style = this.#overrideStyleEle?.cssRules[0]?.style;
1331
+ const style = this.#overrideStyleEle.cssRules[0].style;
1328
1332
 
1329
1333
  if (!style) return;
1330
1334
 
@@ -3411,7 +3415,7 @@ const createStyleMixin =
3411
3415
  if (elementId) {
3412
3416
  // basically this is enough to make the selector more specific
3413
3417
  // but just in case there is no id, we will also add the class multiple times
3414
- classSpecifier += `#${elementId}`;
3418
+ classSpecifier += `#${CSS.escape(elementId)}`;
3415
3419
  }
3416
3420
 
3417
3421
  this.#overrideStyleEle = injectStyle(`:host(${classSpecifier}) {}`, this.#rootElement);
@@ -3420,7 +3424,7 @@ const createStyleMixin =
3420
3424
 
3421
3425
 
3422
3426
  #setAttrOverride(attrName, value) {
3423
- const style = this.#overrideStyleEle?.cssRules[0]?.style;
3427
+ const style = this.#overrideStyleEle.cssRules[0].style;
3424
3428
 
3425
3429
  if (!style) return;
3426
3430