Sha256: c92206a25fb34cfb968e76646e1c04b7566cb8577d7609ee6c9ddd017d5f1bf2

Contents?: true

Size: 1.12 KB

Versions: 7

Compression:

Stored size: 1.12 KB

Contents

$unit_base: 5px;

@function unit_multiplier($n, $base: $unit_base) {
  @if unitless($n) {
    @return $n * $base;
  }
  @else {
    @return $n;
  }
}

@mixin horizontally_spaced($n: 1) {
  &:first-child { margin-left: 0; }
  & {
    float: left;
    margin-left: unit_multiplier($n);
  }
}
@mixin vertically_spaced($n: 1) {
  &:first-child { margin-top: 0; }
  & { margin-top: unit_multiplier($n);  }
}

@mixin horizontal_spacer_container($n: 1, $borders: false) {
  @include float_left_container;

  @if $borders {
    & > :first-child { margin-left: 0; padding-left: 0; }
    & > * { margin-left: unit_multiplier($n, $unit_base/2); padding-left: unit_multiplier($n, $unit_base/2); }
  }
  @else {
    & > :first-child { margin-left: 0; }
    & > * { margin-left: unit_multiplier($n); }
  }
}
@mixin vertical_spacer_container($n: 1, $borders: false) {
  @if $borders {
    & > :first-child { margin-top: 0; padding-top: 0; }
    & > * { margin-top: unit_multiplier($n, $unit_base/2); padding-top: unit_multiplier($n, $unit_base/2); }
  }
  @else {
    & > *:first-child { margin-top: 0; }
    & > * { margin-top: unit_multiplier($n); }
  }
}

Version data entries

7 entries across 7 versions & 1 rubygems

Version Path
patterns-0.1.7 app/assets/stylesheets/alignment/_spacing.scss
patterns-0.1.6 app/assets/stylesheets/alignment/_spacing.scss
patterns-0.1.5 app/assets/stylesheets/alignment/_spacing.scss
patterns-0.1.4 app/assets/stylesheets/alignment/_spacing.scss
patterns-0.1.3 app/assets/stylesheets/alignment/_spacing.scss
patterns-0.1.2 app/assets/stylesheets/alignment/_spacing.scss
patterns-0.1.1 app/assets/stylesheets/alignment/_spacing.scss