<commit_before>// ---------------------------------------------------------------------------
// Isolation

// Isolate the position of a grid element (use in addition to span-columns)
//
// $location  : The grid column to isolate in, relative to the container;
// $context   : [optional] The context (columns spanned by parent).
// $from      : The start direction of your layout (e.g. 'left' for ltr languages)
@mixin isolate(
  $location,
  $context: $total-columns,
  $from: $from-direction,
  $style: fix-static-misalignment()
) {
  $to: opposite-position($from);
  margin-#{$to}: -100%;
  margin-#{$from}: space($location - 1, $context, $style);
}

// Isolate a group of elements in a grid, using nth-child selectors
//
// $columns       : The column-width of each item on the grid;
// $context       : [optional] The context (columns spanned by parent).
// $selector      : [child | of-type | last-of-type ] (default is 'child')
// $from          : The start direction of your layout (e.g. 'left' for ltr languages)
@mixin isolate-grid(
  $columns,
  $context: $total-columns,
  $selector: 'child',
  $from: $from-direction,
  $style: fix-static-misalignment()
) {
  $to: opposite-position($from);
  $location: 1;
  $line: floor($context / $columns);

  @include span-columns($columns, $context, $from: $from, $style: $style);
  margin-#{$to}: -100%;

  @for $item from 1 through $line {
    $nth: '#{$line}n + #{$item}';
    &:#{format-nth($nth,$selector)} {
      margin-#{$from}: space($location - 1, $context, $style);
      @if $location == 1 { clear: $from; }

      $location: $location + $columns;
      @if $location > $context { $location: 1; }
    }
  }
}
<commit_msg>Fixed isolation grid clearing issues<commit_after>// ---------------------------------------------------------------------------
// Isolation

// Isolate the position of a grid element (use in addition to span-columns)
//
// $location  : The grid column to isolate in, relative to the container;
// $context   : [optional] The context (columns spanned by parent).
// $from      : The start direction of your layout (e.g. 'left' for ltr languages)
@mixin isolate(
  $location,
  $context: $total-columns,
  $from: $from-direction,
  $style: fix-static-misalignment()
) {
  $to: opposite-position($from);
  margin-#{$to}: -100%;
  margin-#{$from}: space($location - 1, $context, $style);
}

// Isolate a group of elements in a grid, using nth-child selectors
//
// $columns       : The column-width of each item on the grid;
// $context       : [optional] The context (columns spanned by parent).
// $selector      : [child | of-type | last-of-type ] (default is 'child')
// $from          : The start direction of your layout (e.g. 'left' for ltr languages)
@mixin isolate-grid(
  $columns,
  $context: $total-columns,
  $selector: 'child',
  $from: $from-direction,
  $style: fix-static-misalignment()
) {
  $to: opposite-position($from);
  $location: 1;
  $line: floor($context / $columns);

  @include span-columns($columns, $context, $from: $from, $style: $style);
  margin-#{$to}: -100%;

  @for $item from 1 through $line {
    $nth: '#{$line}n + #{$item}';
    &:#{format-nth($nth,$selector)} {
      margin-#{$from}: space($location - 1, $context, $style);
      @if $location == 1 { clear: $from; }
      @else { clear: none; }

      $location: $location + $columns;
      @if $location > $context { $location: 1; }
    }
  }
}

{'fraction_non_alphanumeric': 0.21011104617182935, 'fraction_numerical': 0.0070134424313267095, 'mean_word_length': 2.6806451612903226, 'pattern_counts': {'":': 0, '<': 3, '<?xml version=': 0, '>': 5, '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': '4979292', 'n_tokens_mistral': 1119, 'n_tokens_neox': 1066, 'n_words': 337}