Sha256: a43d1c083227c6492921e8270bd1648d1a799c8edc0080b329ab7366c3fb4085

Contents?: true

Size: 1.6 KB

Versions: 31

Compression:

Stored size: 1.6 KB

Contents

// Remove last element gutter
@mixin omega($query: block, $direction: default) {
  $table: if(belongs-to(table, $query), true, false);
  $auto: if(belongs-to(auto, $query), true, false);

  @if $direction != default {
    @warn "The omega mixin will no longer take a $direction argument. To change the layout direction, use row($direction) or set $default-layout-direction instead."
  } @else {
    $direction: get-direction($layout-direction, $default-layout-direction);
  }

  @if length($query) == 1 {
    @if $auto {
      &:last-child {
        margin-#{$direction}: 0;
      }
    }

    @else if contains-display-value($query) {
      @if $table {
        padding-#{$direction}: 0;
      }

      @else {
        margin-#{$direction}: 0;
      }
    }

    @else {
      @include nth-child($query, $direction);
    }
  }

  @else if length($query) == 2 {
    @if $table {
      @if $auto {
        &:last-child {
          padding-#{$direction}: 0;
        }
      }

      @else {
        &:nth-child(#{nth($query, 1)}) {
          padding-#{$direction}: 0;
        }
      }
    }

    @else {
      @if $auto {
        &:last-child {
          margin-#{$direction}: 0;
        }
      }

      @else {
        @include nth-child(nth($query, 1), $direction);
      }
    }
  }

  @else {
    @warn "Too many arguments passed to the omega() mixin."
  }
}

@mixin nth-child($query, $direction) {
  $opposite-direction: get-opposite-direction($direction);

  &:nth-child(#{$query}) {
    margin-#{$direction}: 0;
  }

  @if type-of($query) == number {
    &:nth-child(#{$query}+1) {
      clear: $opposite-direction;
    }
  }
}

Version data entries

31 entries across 29 versions & 6 rubygems

Version Path
stump-cli-0.1.3 lib/wp/wp-content/themes/stump/assets/vendor/manhattan/neat/grid/_omega.scss
stump-cli-0.1.2 lib/wp/wp-content/themes/stump/assets/vendor/manhattan/neat/grid/_omega.scss
stump-cli-0.1.1 lib/wp/wp-content/themes/stump/assets/vendor/manhattan/neat/grid/_omega.scss
blogelator-0.2.5 vendor/assets/stylesheets/blogelator/neat/grid/_omega.scss
blocky-0.0.11 vendor/assets/stylesheets/blocky/neat/grid/_omega.scss
blogelator-0.2.4 vendor/assets/stylesheets/blogelator/neat/grid/_omega.scss
blocky-0.0.10 vendor/assets/stylesheets/blocky/neat/grid/_omega.scss
blocky-0.0.9 vendor/assets/stylesheets/blocky/neat/grid/_omega.scss
blocky-0.0.8 vendor/assets/stylesheets/blocky/neat/grid/_omega.scss
blocky-0.0.7 vendor/assets/stylesheets/blocky/neat/grid/_omega.scss
blocky-0.0.6 vendor/assets/stylesheets/blocky/neat/grid/_omega.scss
blocky-0.0.5 vendor/assets/stylesheets/blocky/neat/grid/_omega.scss
blocky-0.0.4 vendor/assets/stylesheets/blocky/neat/grid/_omega.scss
blocky-0.0.3 vendor/assets/stylesheets/blocky/neat/grid/_omega.scss
blocky-0.0.2 vendor/assets/stylesheets/blocky/neat/grid/_omega.scss
blocky-0.0.1 vendor/assets/stylesheets/blocky/neat/grid/_omega.scss
refills-0.0.2 source/stylesheets/neat/grid/_omega.scss
blogelator-0.2.3 vendor/assets/stylesheets/blogelator/neat/grid/_omega.scss
blogelator-0.2.2 vendor/assets/stylesheets/blogelator/grid/_omega.scss
blogelator-0.2.2 vendor/assets/stylesheets/blogelator/neat/grid/_omega.scss