// column generator
@mixin column-generator($size) {
  $column-name: greedy-options('column-class');
  
  // if numbered-column-class is provided, use it instead of column-class
  @if greedy-options('numbered-column-class') {
    $column-name: greedy-options('numbered-column-class');
  }
  
  // if size is provided, insert it at the end of the column-name
  @if $size and $size != '' {
    $column-name: '#{$column-name}-#{$size}';
  }

  // check if grid-wrapper-class is provided
  @if is-enabled('grid-wrapper-class') {
    $column-name: '#{greedy-options('grid-wrapper-class')} .#{$column-name}';
  }
  
  @for $i from 1 through greedy-options('columns') {
    // e.g.: slice-1
    .#{$column-name}-#{$i} {
      width: percentage($i / greedy-options('columns'));
      flex: none;
    }
    
    // run custom column mixins if it does exist and injections are active
    @if is-enabled('injections', 'greedy-custom-column-mixins') {
      @include greedy-custom-column-mixins($size, $i);
    }
  }
}
