Sha256: ecdcac916befb41091199cfd20f1857f215e8d9b9f4eb2f233704d33f0641a79

Contents?: true

Size: 1.38 KB

Versions: 8

Compression:

Stored size: 1.38 KB

Contents

// Isolation Syntax
// ================


// Isolate [Mixin]
// ---------------
// Set isolation as an override.
// - $location: <span>
@mixin isolate(
  $isolate: 1
) {
  $output: (
    push: isolate($isolate),
    flow: susy-get(flow, $isolate),
  );

  @include isolate-output($output...);
}


// Isolate [function]
// ------------------
// Return an isolation offset width.
// - $location: <span>
@function isolate(
  $isolate: 1
) {
  $isolate: parse-span($isolate);
  $isolation: susy-get(span, $isolate);

  @if $isolation and not get-location($isolate) {
    $new: (
      span: null,
      location: $isolation,
    );
    $isolate: map-merge($isolate, $new);
  }

  @return get-isolation($isolate);
}


// Get Isolation
// -------------
// Return the isolation offset width
// - $input: <map>
@function get-isolation(
  $input
) {
  $location   : get-location($input);
  $columns    : susy-get(columns, $input);
  $width      : null;

  @if type-of($location) == number and not unitless($location) {
    $width: $location;
  } @else if $location {
    $push: $location - 1;
    @if $push > 0 {
      $push: map-merge($input, (
        span: $push,
        location: 1,
        spread: wide,
      ));
      $width: get-span-width($push);
    }
  }

  @if susy-get(gutter-position, $input) == split {
    $width: if($width == null, gutters($input), $width + gutters($input));
  }

  @return $width or 0;
}

Version data entries

8 entries across 8 versions & 1 rubygems

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