Sha256: 454cbb0a94910554effe8c0c42047e76ea0cf243a2717e21473e4680dd38e1c3

Contents?: true

Size: 1.37 KB

Versions: 258

Compression:

Stored size: 1.37 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 $table {
    @warn "The omega mixin no longer removes padding in table layouts."
  }

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

    @else if contains-display-value($query) and $table == false {
      margin-#{$direction}: 0;
    }

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

  @else if length($query) == 2 {
    @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

258 entries across 258 versions & 5 rubygems

Version Path
smock-0.1.268 app/assets/stylesheets/thirdparty/neat/grid/_omega.scss
smock-0.1.267 app/assets/stylesheets/thirdparty/neat/grid/_omega.scss
smock-0.1.266 app/assets/stylesheets/thirdparty/neat/grid/_omega.scss
smock-0.1.265 app/assets/stylesheets/thirdparty/neat/grid/_omega.scss
smock-0.1.264 app/assets/stylesheets/thirdparty/neat/grid/_omega.scss
smock-0.1.263 app/assets/stylesheets/thirdparty/neat/grid/_omega.scss
smock-0.1.262 app/assets/stylesheets/thirdparty/neat/grid/_omega.scss
smock-0.1.261 app/assets/stylesheets/thirdparty/neat/grid/_omega.scss
smock-0.1.260 app/assets/stylesheets/thirdparty/neat/grid/_omega.scss
smock-0.1.259 app/assets/stylesheets/thirdparty/neat/grid/_omega.scss
smock-0.1.258 app/assets/stylesheets/thirdparty/neat/grid/_omega.scss
smock-0.1.256 app/assets/stylesheets/thirdparty/neat/grid/_omega.scss
smock-0.1.255 app/assets/stylesheets/thirdparty/neat/grid/_omega.scss
smock-0.1.254 app/assets/stylesheets/thirdparty/neat/grid/_omega.scss
smock-0.1.253 app/assets/stylesheets/thirdparty/neat/grid/_omega.scss
smock-0.1.252 app/assets/stylesheets/thirdparty/neat/grid/_omega.scss
smock-0.1.251 app/assets/stylesheets/thirdparty/neat/grid/_omega.scss
smock-0.1.250 app/assets/stylesheets/thirdparty/neat/grid/_omega.scss
smock-0.1.249 app/assets/stylesheets/thirdparty/neat/grid/_omega.scss
smock-0.1.247 app/assets/stylesheets/thirdparty/neat/grid/_omega.scss