Sha256: 6632938e5b90fcdfab6c4eac9986891ee7281ca85674ba0bd8c42e161b213cdc

Contents?: true

Size: 1.84 KB

Versions: 8

Compression:

Stored size: 1.84 KB

Contents

// Margin Syntax
// =============

// Pre
// ---
// Add spanning-margins before an element.
// - $span  : <span>
@mixin pre(
  $span
) {
  $span   : map-merge((spread: wide), parse-span($span));
  $flow   : susy-get(flow, $span);
  $split  : if(susy-get(gutter-position, $span) == split, true, false);
  $width  : if($split, span($span) + gutter($span), span($span));

  @include margin-output($width, null, $flow);
}

// Post
// ----
// Add spanning-margins after an element.
// - $span  : <span>
@mixin post(
  $span
) {
  $span   : map-merge((spread: wide), parse-span($span));
  $flow   : susy-get(flow, $span);
  $split  : if(susy-get(gutter-position, $span) == split, true, false);
  $width  : if($split, span($span) + gutter($span), span($span));

  @include margin-output(null, $width, $flow);
}

// Push
// ----
// Simple synonymn for pre.
// - $span  : <span>
@mixin push(
  $span
) {
  @include pre($span);
}

// Pull
// ----
// Add negative spanning-margins before an element.
// - $span  : <span>
@mixin pull(
  $span
) {
  $span   : map-merge((spread: wide), parse-span($span));
  $flow   : susy-get(flow, $span);
  $split  : if(susy-get(gutter-position, $span) == split, true, false);
  $width  : if($split, 0 - span($span) + gutter($span), 0 - span($span));

  @include margin-output($width, null, $flow);
}

// Squish
// ------
// Add spanning-margins before and after an element.
// - $pre     : <span>
// - [$post]  : <span>
@mixin squish(
  $pre,
  $post: false
) {
  $pre: map-merge((spread: wide), parse-span($pre));

  @if $post {
    $post: map-merge((spread: wide), parse-span($post));
  } @else {
    $span: susy-get(span, $pre);
    @if length($span) > 1 {
      $pre: map-merge($pre, (span: nth($span, 1)));
      $post: map-merge($pre, (span: nth($span, 2)));
    } @else {
      $post: $pre;
    }
  }

  @include pre($pre);
  @include post($post);
}

Version data entries

8 entries across 8 versions & 1 rubygems

Version Path
susy-2.1.2 sass/susy/language/susy/_margins.scss
susy-2.1.1 sass/susy/language/susy/_margins.scss
susy-2.1.0 sass/susy/language/susy/_margins.scss
susy-2.0.0 sass/susy/language/susy/_margins.scss
susy-2.0.0.rc.2 sass/susy/language/susy/_margins.scss
susy-2.0.0.rc.1 sass/susy/language/susy/_margins.scss
susy-2.0.0.beta.3 sass/susy/language/susy/_margins.scss
susy-2.0.0.beta.2 sass/susy/language/susy/_margins.scss