<commit_before>
@function containsModifier($selector) {
  $selector: selectorToString($selector);
  @if str-index($selector, $modifier-separator) {
    @return true;
  } @else {
    @return false;
  }
}

@function selectorToString($selector) {
  $selector: inspect($selector); //cast to string
  $selector: str-slice($selector, 2, -2); //remove brackets
  @return $selector;
}

@function getBlock($selector) {
  $selector: selectorToString($selector);
  $modifierStart: str-index($selector, $modifier-separator) - 1;
  @return str-slice($selector, 0, $modifierStart);
}

@mixin b($block) {
  .#{$namespace+'-'+$block} {
    @content;
  }
}

@mixin e($element...) {
  $selector: &;
  @if containsModifier($selector) {
    $block: getBlock($selector);
    $currentSelector: '';
    @each $unit in $element {
      $currentSelector: #{$currentSelector + $block + $element-separator + $unit + ","};
    }
    $currentSelector: str-slice($currentSelector, 0, str-length($currentSelector) - 1);

    // @debug $currentSelector;
    @at-root {
      #{$selector} {
        #{$currentSelector} {
          @content;
        }
      }
    }
  } @else {
    $currentSelector: '';
    @each $unit in $element {
      $currentSelector: #{$currentSelector + $selector + $element-separator + $unit + ","};
    }
    $currentSelector: str-slice($currentSelector, 0, str-length($currentSelector) - 1);
    // @debug $currentSelector;

    @at-root {
      #{$currentSelector} {
        // @debug &;
        @content;
      }
    }
  }
}

@mixin m($modifier) {
  @at-root {
    #{&}#{$modifier-separator+$modifier} {
      @content;
    }
  }
}

@mixin placeholder {
  &::-webkit-input-placeholder {
    @content
  }

  &::-moz-placeholder {
    @content<commit_msg>style: add function for get elements of bem mixin<commit_after>
@function containsModifier($selector) {
  $selector: selectorToString($selector);
  @if str-index($selector, $modifier-separator) {
    @return true;
  } @else {
    @return false;
  }
}

@function selectorToString($selector) {
  $selector: inspect($selector); //cast to string
  $selector: str-slice($selector, 2, -2); //remove brackets
  @return $selector;
}

@function getBlock($selector) {
  $selector: selectorToString($selector);
  $modifierStart: str-index($selector, $modifier-separator) - 1;
  @return str-slice($selector, 0, $modifierStart);
}

@function getElements($elements) {
  $selector: &;
  $currentSelector: '';
  @if containsModifier($selector) {
    $selector: getBlock($selector);
  }
  @each $unit in $elements {
    $currentSelector: #{$currentSelector + $selector + $element-separator + $unit + ','};
  }
  $currentSelector: str-slice($currentSelector, 0, str-length($currentSelector) - 1);
  @return $currentSelector;
}

@mixin b($block) {
  .#{$namespace + '-' + $block} {
    @content;
  }
}

@mixin e($element...) {
  $selector: &;
  $elements: getElements($element);
  // @debug $elements;
  @if containsModifier($selector) {
    @at-root {
      #{$selector} {
        #{$elements} {
          @content;
        }
      }
    }
  } @else {
    @at-root {
      #{$elements} {
        @content;
      }
    }
  }
}

@mixin m($modifier) {
  @at-root {
    #{&}#{$modifier-separator + $modifier} {
      @content;
    }
  }
}

@mixin placeholder {
  &::-webkit-input-placeholder {
    @content
  }

  &::-moz-placeholder {
    @content
{'fraction_non_alphanumeric': 0.17837037037037037, 'fraction_numerical': 0.004148148148148148, 'mean_word_length': 3.1372549019607843, 'pattern_counts': {'":': 0, '<': 3, '<?xml version=': 0, '>': 3, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 0, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '1871593', 'n_tokens_mistral': 1148, 'n_tokens_neox': 1112, 'n_words': 210}