cotomy 0.4.5 → 0.4.6

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.
@@ -1008,9 +1008,9 @@ class CotomyElement {
1008
1008
  const cssid = this.scopedCssElementId;
1009
1009
  CotomyElement.find(`#${cssid}`).forEach(e => e.remove());
1010
1010
  const element = document.createElement("style");
1011
- const hasScopeOrRoot = /\[(?:scope|root)\]/.test(css);
1012
- const normalizedCss = hasScopeOrRoot ? css : `[root] ${css}`;
1013
- const writeCss = normalizedCss.replace(/\[(?:scope|root)\]/g, `[data-cotomy-scopeid="${this.scopeId}"]`);
1011
+ const hasRoot = /\[root\]/.test(css);
1012
+ const normalizedCss = hasRoot ? css : `[root] ${css}`;
1013
+ const writeCss = normalizedCss.replace(/\[root\]/g, `[data-cotomy-scopeid="${this.scopeId}"]`);
1014
1014
  const node = document.createTextNode(writeCss);
1015
1015
  element.appendChild(node);
1016
1016
  element.id = cssid;