styled-components 6.1.4 → 6.1.5

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.
@@ -10,7 +10,7 @@
10
10
  'data-styled';
11
11
  var SC_ATTR_ACTIVE = 'active';
12
12
  var SC_ATTR_VERSION = 'data-styled-version';
13
- var SC_VERSION = "6.1.4";
13
+ var SC_VERSION = "6.1.5";
14
14
  var SPLITTER = '/*!sc*/\n';
15
15
  var IS_BROWSER = typeof window !== 'undefined' && 'HTMLElement' in window;
16
16
  var DISABLE_SPEEDY = Boolean(typeof SC_DISABLE_SPEEDY === 'boolean'
@@ -633,7 +633,6 @@
633
633
  // add the namespace to the start
634
634
  rule.value = "".concat(namespace, " ").concat(rule.value);
635
635
  // add the namespace after each comma for subsequent selectors.
636
- // @ts-expect-error we target modern browsers but intentionally transpile to ES5 for speed
637
636
  rule.value = rule.value.replaceAll(',', ",".concat(namespace, " "));
638
637
  rule.props = rule.props.map(function (prop) {
639
638
  return "".concat(namespace, " ").concat(prop);
@@ -653,15 +652,12 @@
653
652
  var selfReferenceReplacer = function (match, offset, string) {
654
653
  if (
655
654
  /**
656
- * We only want to refer to the static class directly in the following scenarios:
657
- *
658
- * 1. The selector is alone on the line `& { color: red; }`
659
- * 2. The selector is part of a self-reference selector `& + & { color: red; }`
655
+ * We only want to refer to the static class directly if the selector is part of a
656
+ * self-reference selector `& + & { color: red; }`
660
657
  */
661
- string === _selector ||
662
- (string.startsWith(_selector) &&
663
- string.endsWith(_selector) &&
664
- string.replaceAll(_selector, '').length > 0)) {
658
+ string.startsWith(_selector) &&
659
+ string.endsWith(_selector) &&
660
+ string.replaceAll(_selector, '').length > 0) {
665
661
  return ".".concat(_componentId);
666
662
  }
667
663
  return match;