Sha256: 366aebfd66206e01c887ffe2ebd2d58c1a3bd5558c0bd1ff961509d26f8f62f8

Contents?: true

Size: 792 Bytes

Versions: 3

Compression:

Stored size: 792 Bytes

Contents

// Foundation for Sites by ZURB
// foundation.zurb.com
// Licensed under MIT Open Source

////
/// @group functions
////

/// Returns the opposite direction of $dir
///
/// @param {Keyword} $dir - Used direction between "top", "right", "bottom" and "left".
/// @return {Keyword} Opposite direction of $dir
@function direction-opposite(
  $dir
) {
  $dirs: (top, right, bottom, left);
  $place: index($dirs, $dir);

  @if $place == null {
    @error 'direction-opposite: Invalid $dir parameter, expected a value from "#{$dirs}", found "#{$dir}".';
    @return null;
  }

  // Calculate the opposite place in a circle, with a starting index of 1
  $length: length($dirs);
  $demi: $length / 2;
  $opposite-place: (($place + $demi - 1) % $length) + 1;

  @return nth($dirs, $opposite-place);
}

Version data entries

3 entries across 3 versions & 1 rubygems

Version Path
foundation-rails-6.6.1.0 vendor/assets/scss/util/_direction.scss
foundation-rails-6.5.3.0 vendor/assets/scss/util/_direction.scss
foundation-rails-6.5.1.0 vendor/assets/scss/util/_direction.scss