<commit_before>//============================================
// Grid system
//============================================


// Config example
//============================================

// $config: (
//   "name": "xs",
//   "cols": 24,
//   "gutter": 15px,
//   "bp": false,
//   "off": false,
//   "pull": false,
//   "push": false,
// );


// Main mixin
//============================================

=grid($configs...)
  // Default Classes
  .g-row
    +cf

  .g
    float: left
    width: 100%
    min-height: 0.1rem
    position: relative

  @each $config in $configs

    // Get config
    $name:    map-get($config, "name")
    $cols:    map-get($config, "cols")
    $gutter-lft:  map-get($config, "gutter") / 2
    $gutter-rgt:  map-get($config, "gutter") / 2

    @if str-length($name) != 0
      $name: "#{\@}#{$name}"

    // Base unit
    $base: (100% / 12)

    @if $cols
      $base: (100% / $cols)

    +mq(map-get($config, "bp"))

      // Update row
      .g-row
        margin-left: -$gutter-lft
        margin-right: -$gutter-rgt

      // Update unit
      .g
        padding-left: $gutter-lft
        padding-right: $gutter-rgt

      // Clear
      @if map-get($config, "clear")
        @each $col in map-get($config, "clear")
          $nth-val: "#{$col}n + 1"

          .g-clear-#{$col}#{$name}
            > .g
              &:nth-child(#{$nth-val})
                clear: left

              &:not(:nth-child(#{$nth-val}))
                clear: none

      // Units
      @if $cols
        @for $i from 1 through $cols
          .g-#{$i}#{$name}
            width: $base * $i

      // Helpers
      +grid-helper($config, "off", margin-left, 0)
      +grid-helper($config, "pull", right, auto)
      +grid-helper($config, "push", left, auto)


// Helper mixin
//============================================

=grid-helper ($config, $type, $prop, $val0)
  $name: map-get($config, "name")
  $cols: map-get($config, "cols")
  $base: (100% / $cols)

  @if str-length($name) != 0
    $name: "#{\@}#{$name}"

  @if $cols
    @if map-get($config, $type)
      $class-name: "g-#{$type}-0-"

      .#{$class-name}#{$name}
        #{$prop}: $val0

      $class-name: "g-#{$type}-"
      @for $i from 1 to $cols
        .#{$class-name}#{$i}#{$name}
          #{$prop}: $base * $i<commit_msg>fix bug for grid 0 classes<commit_after>//============================================
// Grid system
//============================================


// Config example
//============================================

// $config: (
//   "name": "xs",
//   "cols": 24,
//   "gutter": 15px,
//   "bp": false,
//   "off": false,
//   "pull": false,
//   "push": false,
// );


// Main mixin
//============================================

=grid($configs...)
  // Default Classes
  .g-row
    +cf

  .g
    float: left
    width: 100%
    min-height: 0.1rem
    position: relative

  @each $config in $configs

    // Get config
    $name:    map-get($config, "name")
    $cols:    map-get($config, "cols")
    $gutter-lft:  map-get($config, "gutter") / 2
    $gutter-rgt:  map-get($config, "gutter") / 2

    @if str-length($name) != 0
      $name: "#{\@}#{$name}"

    // Base unit
    $base: (100% / 12)

    @if $cols
      $base: (100% / $cols)

    +mq(map-get($config, "bp"))

      // Update row
      .g-row
        margin-left: -$gutter-lft
        margin-right: -$gutter-rgt

      // Update unit
      .g
        padding-left: $gutter-lft
        padding-right: $gutter-rgt

      // Clear
      @if map-get($config, "clear")
        @each $col in map-get($config, "clear")
          $nth-val: "#{$col}n + 1"

          .g-clear-#{$col}#{$name}
            > .g
              &:nth-child(#{$nth-val})
                clear: left

              &:not(:nth-child(#{$nth-val}))
                clear: none

      // Units
      @if $cols
        @for $i from 1 through $cols
          .g-#{$i}#{$name}
            width: $base * $i

      // Helpers
      +grid-helper($config, "off", margin-left, 0)
      +grid-helper($config, "pull", right, auto)
      +grid-helper($config, "push", left, auto)


// Helper mixin
//============================================

=grid-helper ($config, $type, $prop, $val0)
  $name: map-get($config, "name")
  $cols: map-get($config, "cols")
  $base: (100% / $cols)

  @if str-length($name) != 0
    $name: "#{\@}#{$name}"

  @if $cols
    @if map-get($config, $type)
      $class-name: "g-#{$type}-0"

      .#{$class-name}#{$name}
        #{$prop}: $val0

      $class-name: "g-#{$type}-"
      @for $i from 1 to $cols
        .#{$class-name}#{$i}#{$name}
          #{$prop}: $base * $i
{'fraction_non_alphanumeric': 0.2933189655172414, 'fraction_numerical': 0.013577586206896551, 'mean_word_length': 2.0234527687296415, 'pattern_counts': {'":': 14, '<': 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': '6621813', 'n_tokens_mistral': 1734, 'n_tokens_neox': 1589, 'n_words': 356}