Sha256: 972d7da7cd459c2ef5d5fa11e62137eb59c09b13e8b6d5a325a5e9d808b83af1

Contents?: true

Size: 787 Bytes

Versions: 1

Compression:

Stored size: 787 Bytes

Contents

// Foundation for Sites
// https://get.foundation
// 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

1 entries across 1 versions & 1 rubygems

Version Path
foundation-rails-6.6.2.0 vendor/assets/scss/util/_direction.scss