Sha256: b6db048228c40669ac251bbbdd58f99c75e4be59c6dcdc5a0e340404cca71d67

Contents?: true

Size: 1.02 KB

Versions: 1

Compression:

Stored size: 1.02 KB

Contents

@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; }
  & { 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, $bordered: false) {
  @if $bordered {
    & > :first-child { margin-left: 0; padding-left: 0; }
    & > * { margin-left: unit_multiplier($n, 2.5px); padding-left: unit_multiplier($n, 2.5px); }
  }
  @else {
    & > :first-child { margin-left: 0; }
    & > * { margin-left: unit_multiplier($n); }
  }
}
@mixin vertical_spacer_container($n: 1, $bordered: false) {
  @if $bordered {
    & > :first-child { margin-top: 0; padding-top: 0; }
    & > * { margin-top: unit_multiplier($n, 2.5px); padding-top: unit_multiplier($n, 2.5px); }
  }
  @else {
    & > *:first-child { margin-top: 0; }
    & > * { margin-top: unit_multiplier($n); }
  }
}

Version data entries

1 entries across 1 versions & 1 rubygems

Version Path
patterns-0.0.1 app/assets/stylesheets/alignment/_spacing.scss