Sha256: dd2c8333de7895a630a009d34d15c15a5324835a2ac09943aad7911a12cfd7cc

Contents?: true

Size: 1.3 KB

Versions: 7

Compression:

Stored size: 1.3 KB

Contents

@charset "UTF-8";

// scss-lint:disable ElsePlacement

/// Directional-property mixins are shorthands for writing properties like
/// the following.
///
/// @ignore You can also use `false` instead of `null`.
///
/// @argument {list} $values
///   List of directional values.
///
/// @example scss - Usage
///   .element {
///     @include border-style(dotted null);
///     @include margin(null 0 10px);
///   }
///
/// @example css - CSS Output
///   .element {
///     border-bottom-style: dotted;
///     border-top-style: dotted;
///     margin-bottom: 10px;
///     margin-left: 0;
///     margin-right: 0;
///   }
///
/// @return {list}
///
/// @access private

@function _collapse-directionals($values) {
  $output: null;

  $a: nth($values, 1);
  $b: if(length($values) < 2, $a, nth($values, 2));
  $c: if(length($values) < 3, $a, nth($values, 3));
  $d: if(length($values) < 2, $a, nth($values, if(length($values) < 4, 2, 4)));

  @if $a == 0 { $a: 0; }
  @if $b == 0 { $b: 0; }
  @if $c == 0 { $c: 0; }
  @if $d == 0 { $d: 0; }

  @if $a == $b and $a == $c and $a == $d { $output: $a;          }
  @else if $a == $c and $b == $d         { $output: $a $b;       }
  @else if $b == $d                      { $output: $a $b $c;    }
  @else                                  { $output: $a $b $c $d; }

  @return $output;
}

Version data entries

7 entries across 7 versions & 2 rubygems

Version Path
garth-jekyll-theme-0.1.9 _sass/bourbon/bourbon/utilities/_collapse-directionals.scss
bourbon-5.0.0.beta.6 core/bourbon/utilities/_collapse-directionals.scss
bourbon-5.0.0.beta.5 core/bourbon/utilities/_collapse-directionals.scss
bourbon-5.0.0.beta.4 core/bourbon/utilities/_collapse-directionals.scss
bourbon-5.0.0.beta.3 core/bourbon/utilities/_collapse-directionals.scss
bourbon-5.0.0.beta.2 core/bourbon/utilities/_collapse-directionals.scss
bourbon-5.0.0.beta.1 core/bourbon/functions/_collapse-directionals.scss