Sha256: 97aa5555a77baff25a8e610eef22e5eb7aa7c6b4f12ee0d59b07f10940429274

Contents?: true

Size: 1.06 KB

Versions: 7

Compression:

Stored size: 1.06 KB

Contents

@charset "UTF-8";

/// Provides a quick method for setting an element’s position. Use a `null`
/// value to “skip” a side.
///
/// @argument {string} $position [relative]
///   A CSS position value.
///
/// @argument {arglist} $coordinates [null]
///   List of lengths, defined as CSS shorthand.
///
/// @example scss
///   .element {
///     @include position(absolute, 0 null null 10em);
///   }
///
/// @example css
///   .element {
///     left: 10em;
///     position: absolute;
///     top: 0;
///   }
///
/// @require {function} _is-length
///
/// @require {function} _unpack

@mixin position(
    $position: relative,
    $coordinates: null
  ) {

  @if type-of($position) == list {
    $coordinates: $position;
    $position: relative;
  }

  $coordinates: _unpack($coordinates);

  $offsets: (
    top:    nth($coordinates, 1),
    right:  nth($coordinates, 2),
    bottom: nth($coordinates, 3),
    left:   nth($coordinates, 4),
  );

  position: $position;

  @each $offset, $value in $offsets {
    @if _is-length($value) {
      #{$offset}: $value;
    }
  }
}

Version data entries

7 entries across 7 versions & 2 rubygems

Version Path
garth-jekyll-theme-0.1.9 _sass/bourbon/bourbon/library/_position.scss
bourbon-5.0.0.beta.6 core/bourbon/library/_position.scss
bourbon-5.0.0.beta.5 core/bourbon/library/_position.scss
bourbon-5.0.0.beta.4 core/bourbon/library/_position.scss
bourbon-5.0.0.beta.3 core/bourbon/library/_position.scss
bourbon-5.0.0.beta.2 core/bourbon/library/_position.scss
bourbon-5.0.0.beta.1 core/bourbon/addons/_position.scss