<commit_before>// ---------------------------------------------------------------------------
// Container

// Set the outer grid-containing element(s).
@mixin apply-container(){
  @include pie-clearfix;
  margin-left: auto;
  margin-right: auto;
  width: columns-width();
  max-width: 100%;
}

// Set one or more layouts on a grid-containing element at any number of media-query breakpoints.
//
// $media-layout-1        : [default:$total-cols] A list of values including -
//                        : One unitless number (representing columns in a layout)
//                        : Two optional lengths (representing min and max-width media-query breakpoints).
// $media-layout-2 ...-10 : [optional] Same as $media-layout-1
@mixin container(
  $media-layout-1   : $total-cols,
  $media-layout-2   : false,
  $media-layout-3   : false,
  $media-layout-4   : false,
  $media-layout-5   : false,
  $media-layout-6   : false,
  $media-layout-7   : false,
  $media-layout-8   : false,
  $media-layout-9   : false,
  $media-layout-10  : false
){
  $media-layouts    : compact($media-layout-2,$media-layout-3,$media-layout-4,$media-layout-5,$media-layout-6,$media-layout-7,$media-layout-8,$media-layout-9,$media-layout-10);

  @if is-default-layout($media-layout-1) {
    @include apply-container();
  } @else {
    $media-layouts: join($media-layout-1,$media-layouts);
  }

  @each $ml in $media-layouts {
    @if $ml {
      @include at-breakpoint($ml) {
        @include apply-container();
      }
    }
  }
}

// ---------------------------------------------------------------------------
// Column Mixins

// Create a grid element spanning any number of 'columns' in a grid 'context'.
// $columns : The number of columns to span.
// $context : [optional] The context (columns spanned by parent).
//          : Context is required on any nested elements.
//          : Context MUST NOT be declared on a root element.
// $from    : The start direction of your layout (e.g. 'left' for ltr languages)
@mixin columns(
  $columns,
  $context  : false,
  $from     : $from-direction
) {
  $to       : opposite-position($from);
  $pos      : false;
  $cols     : false;
  
  @each $var in $columns {
    @if (type-of($var) == 'string') {
      $pos: $var;
    } @else {
      @if (type-of($var) == 'number') and (unitless($var)) {
        $cols: $var;
      } @else {
        @warn '"#{$var}" is not a valid part of "$columns: #{$columns}" in the columns() mixin.';
      }
    } 
  }
  
  @if ($pos == 'full') {
    clear: both;
    @if not $context {
      margin: {
        left: side-gutter();
        right: side-gutter();
      }
    }
  } @else {
    @if ($pos == 'alpha') {
      @if not $context {
        margin-#{$from}: side-gutter();
      } @else {
        @warn "The alpha argument is not needed in a nested context";
      }
    }

    @if ($pos == 'omega') {
      @include float($omega-float);  
      margin-#{$to}: gutter($context);
    } @else {  
      @include float($from);
    }
    
    width: columns($cols, $context);
  }
}

// Reset a '+columns' grid element to default block behavior
//
// $from  : The start direction of your layout (e.g. 'left' for ltr languages)
@mixin reset-columns(
  $from : $from-direction
) {
  $to   : opposite-position($from);
  
  @include reset-float;
  width: auto;
  margin-#{$to}: auto;
}

@mixin reset-column(
  $from : $from-direction
) {
  @include reset-columns($from);
  @warn "reset-column in deprecated. please use reset-columns instead.";
}

@mixin un-column(
  $from : $from-direction
) {
  @include reset-columns($from);
  @warn "un-column in deprecated. please use reset-columns instead.";
}

// Create a grid element that will span it's entire context.
// There is no need for +columns, +alpha or +omega on a +full element.
//
// $context : The context in columns, when nested.
@mixin full(
  $context: false
) {
  @include columns(full,$context)
}

// @include `reset-full` to reset a full-width element to default block behavior.
//
// $context : The context in columns, when nested.
@mixin reset-full(
  $context: false
) {
  clear: none;
  @if not $context {
    margin: {
      left: auto;
      right: auto;
    }
  };
}

// ---------------------------------------------------------------------------
// Alpha & Omega Mixins
//
// I recommend that you pass the actual nested contexts (when nested)
// rather than a true/false argument (for the sake of consistency).
// The effect is the same, but your code will be much more readable.

// Apply to elements spanning the first column to account for side-gutters.
// - Only needed in the root context, and in conjunction with side-gutters.
//
// $context   : If you need it, you don't need alpha.
// $from      : The start-direction for your document.
@mixin alpha(
  $context  : false,
  $from     : $from-direction
) {
  @if not $context {
    margin-#{$from}: side-gutter();
  } @else {
    @warn "The alpha mixin is not needed in a nested context";
  }
}

// Apply to elements spanning the last column, to account for side-gutters & page edge.
//
// $context : The context in columns, when nested.
// $from    : The start-direction for your document.
@mixin omega(
  $context  : false,
  $from     : $from-direction
) {
  $to     : opposite-position($from);
  $hack   : opposite-position($omega-float);
  $sg     : 0;
  
  @if not $context {
    $sg: side-gutter();
  }
  
  @include float($omega-float);
  margin-#{$to}: $sg;
  @if $legacy-support-for-ie6 or $legacy-support-for-ie7 {
    #margin-#{$hack}: - $gutter-width;
  }
}<commit_msg>fix omega-handling in +columns()<commit_after>// ---------------------------------------------------------------------------
// Container

// Set the outer grid-containing element(s).
@mixin apply-container(){
  @include pie-clearfix;
  margin-left: auto;
  margin-right: auto;
  width: columns-width();
  max-width: 100%;
}

// Set one or more layouts on a grid-containing element at any number of media-query breakpoints.
//
// $media-layout-1        : [default:$total-cols] A list of values including -
//                        : One unitless number (representing columns in a layout)
//                        : Two optional lengths (representing min and max-width media-query breakpoints).
// $media-layout-2 ...-10 : [optional] Same as $media-layout-1
@mixin container(
  $media-layout-1   : $total-cols,
  $media-layout-2   : false,
  $media-layout-3   : false,
  $media-layout-4   : false,
  $media-layout-5   : false,
  $media-layout-6   : false,
  $media-layout-7   : false,
  $media-layout-8   : false,
  $media-layout-9   : false,
  $media-layout-10  : false
){
  $media-layouts    : compact($media-layout-2,$media-layout-3,$media-layout-4,$media-layout-5,$media-layout-6,$media-layout-7,$media-layout-8,$media-layout-9,$media-layout-10);

  @if is-default-layout($media-layout-1) {
    @include apply-container();
  } @else {
    $media-layouts: join($media-layout-1,$media-layouts);
  }

  @each $ml in $media-layouts {
    @if $ml {
      @include at-breakpoint($ml) {
        @include apply-container();
      }
    }
  }
}

// ---------------------------------------------------------------------------
// Column Mixins

// Create a grid element spanning any number of 'columns' in a grid 'context'.
// $columns : The number of columns to span.
// $context : [optional] The context (columns spanned by parent).
//          : Context is required on any nested elements.
//          : Context MUST NOT be declared on a root element.
// $from    : The start direction of your layout (e.g. 'left' for ltr languages)
@mixin columns(
  $columns,
  $context  : false,
  $from     : $from-direction
) {
  $hack     : opposite-position($omega-float);
  $to       : opposite-position($from);
  $sg       : if($context,0,side-gutter());
  $pos      : false;
  $cols     : false;
  
  @each $var in $columns {
    @if (type-of($var) == 'string') {
      $pos: $var;
    } @else {
      @if (type-of($var) == 'number') and (unitless($var)) {
        $cols: $var;
      } @else {
        @warn '"#{$var}" is not a valid part of "$columns: #{$columns}" in the columns() mixin.';
      }
    } 
  }

  width: columns($cols, $context);

  @if ($pos == 'full') {
    clear: both;
    @if not $context {
      margin: {
        left: side-gutter();
        right: side-gutter();
      }
    }
  } @else {
    @if ($pos == 'alpha') {
      @if not $context {
        margin-#{$from}: side-gutter();
      } @else {
        @warn "The alpha argument is not needed in a nested context";
      }
    }

    @if ($pos == 'omega') {
      @include float($omega-float);
      margin-#{$to}: $sg;
      @if $legacy-support-for-ie6 or $legacy-support-for-ie7 {
        #margin-#{$hack}: - $gutter-width;
      }
    } @else {  
      @include float($from);
      margin-#{$to}: gutter($context);      
    }
  }
}

// Reset a '+columns' grid element to default block behavior
//
// $from  : The start direction of your layout (e.g. 'left' for ltr languages)
@mixin reset-columns(
  $from : $from-direction
) {
  $to   : opposite-position($from);
  
  @include reset-float;
  width: auto;
  margin-#{$to}: auto;
}

@mixin reset-column(
  $from : $from-direction
) {
  @include reset-columns($from);
  @warn "reset-column in deprecated. please use reset-columns instead.";
}

@mixin un-column(
  $from : $from-direction
) {
  @include reset-columns($from);
  @warn "un-column in deprecated. please use reset-columns instead.";
}

// Create a grid element that will span it's entire context.
// There is no need for +columns, +alpha or +omega on a +full element.
//
// $context : The context in columns, when nested.
@mixin full(
  $context: false
) {
  @include columns(full,$context)
}

// @include `reset-full` to reset a full-width element to default block behavior.
//
// $context : The context in columns, when nested.
@mixin reset-full(
  $context: false
) {
  clear: none;
  @if not $context {
    margin: {
      left: auto;
      right: auto;
    }
  };
}

// ---------------------------------------------------------------------------
// Alpha & Omega Mixins
//
// I recommend that you pass the actual nested contexts (when nested)
// rather than a true/false argument (for the sake of consistency).
// The effect is the same, but your code will be much more readable.

// Apply to elements spanning the first column to account for side-gutters.
// - Only needed in the root context, and in conjunction with side-gutters.
//
// $context   : If you need it, you don't need alpha.
// $from      : The start-direction for your document.
@mixin alpha(
  $context  : false,
  $from     : $from-direction
) {
  @if not $context {
    margin-#{$from}: side-gutter();
  } @else {
    @warn "The alpha mixin is not needed in a nested context";
  }
}

// Apply to elements spanning the last column, to account for side-gutters & page edge.
//
// $context : The context in columns, when nested.
// $from    : The start-direction for your document.
@mixin omega(
  $context  : false,
  $from     : $from-direction
) {
  $to     : opposite-position($from);
  $hack   : opposite-position($omega-float);
  $sg     : if($context,0,side-gutter());
  
  @include float($omega-float);
  margin-#{$to}: $sg;
  @if $legacy-support-for-ie6 or $legacy-support-for-ie7 {
    #margin-#{$hack}: - $gutter-width;
  }
}
{'fraction_non_alphanumeric': 0.18798978603504446, 'fraction_numerical': 0.0062516509641630715, 'mean_word_length': 2.223956854953165, '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': '5590464', 'n_tokens_mistral': 3664, 'n_tokens_neox': 3569, 'n_words': 1078}