Sha256: d374fec7b897d3ce1c4e0b7599d41cd2fcc0d3e01287502fddd7a8bb398001e8

Contents?: true

Size: 1.7 KB

Versions: 2

Compression:

Stored size: 1.7 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: $pre
) {
  $pre      : if(length($pre) == 1 and length($post) > 1, set-nth($post, 1, $pre), $pre);
  $pre      : map-merge((spread: wide), parse-span($pre));
  $post     : map-merge((spread: wide), parse-span($post));

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

Version data entries

2 entries across 2 versions & 1 rubygems

Version Path
susy-2.0.0.beta.1 sass/susy/language/susy/_margins.scss
susy-2.0.0.alpha.6 sass/susy/language/susy/_margins.scss