Sha256: 0490a599383e391a4de4b7d4064c417ef03b12ab70cd955958039e8c4de3a61e

Contents?: true

Size: 971 Bytes

Versions: 40

Compression:

Stored size: 971 Bytes

Contents

//
// Positions
//

@mixin position($position, $args: ()) {
  $offsets: top right bottom left;
  position: $position;

  @each $offset in $offsets {
    $index: index($args, $offset);

    @if $index {
      @if $index == length($args) {
        #{$offset}: 0;
      }
      @else {
        $next: nth($args, $index + 1);
        @if is-valid-length($next) {
          @include px-to-rem(#{$offset}, $next);
        }
        @else if index($offsets, $next) {
          #{$offset}: 0;
        }
        @else {
          @warn "Invalid value '#{$next}'' for offset '#{$offset}'.";
        }
      }
    }
  }
}
@function is-valid-length($value) {
  @return (type-of($value) == "number" and not unitless($value))
    or (index(auto initial inherit 0, $value) != false);
}
@mixin absolute($args: ()) {
  @include position(absolute, $args);
}
@mixin fixed($args: ()) {
  @include position(fixed, $args);
}
@mixin relative($args: ()) {
  @include position(relative, $args);
}

Version data entries

40 entries across 40 versions & 1 rubygems

Version Path
jekyll-theme-glueckkanja-1.2.29 _sass/unify/tools/mixins/_positions.scss
jekyll-theme-glueckkanja-1.2.28 _sass/unify/tools/mixins/_positions.scss
jekyll-theme-glueckkanja-1.2.27 _sass/unify/tools/mixins/_positions.scss
jekyll-theme-glueckkanja-1.2.26 _sass/unify/tools/mixins/_positions.scss
jekyll-theme-glueckkanja-1.2.25 _sass/unify/tools/mixins/_positions.scss
jekyll-theme-glueckkanja-1.2.24 _sass/unify/tools/mixins/_positions.scss
jekyll-theme-glueckkanja-1.2.23 _sass/unify/tools/mixins/_positions.scss
jekyll-theme-glueckkanja-1.2.22 _sass/unify/tools/mixins/_positions.scss
jekyll-theme-glueckkanja-1.2.21 _sass/unify/tools/mixins/_positions.scss
jekyll-theme-glueckkanja-1.2.20 _sass/unify/tools/mixins/_positions.scss
jekyll-theme-glueckkanja-1.2.19 _sass/unify/tools/mixins/_positions.scss
jekyll-theme-glueckkanja-1.2.18 _sass/unify/tools/mixins/_positions.scss
jekyll-theme-glueckkanja-1.2.17 _sass/unify/tools/mixins/_positions.scss
jekyll-theme-glueckkanja-1.2.16 _sass/unify/tools/mixins/_positions.scss
jekyll-theme-glueckkanja-1.2.15 _sass/unify/tools/mixins/_positions.scss
jekyll-theme-glueckkanja-1.2.14 _sass/unify/tools/mixins/_positions.scss
jekyll-theme-glueckkanja-1.2.13 _sass/unify/tools/mixins/_positions.scss
jekyll-theme-glueckkanja-1.2.12 _sass/unify/tools/mixins/_positions.scss
jekyll-theme-glueckkanja-1.2.11 _sass/unify/tools/mixins/_positions.scss
jekyll-theme-glueckkanja-1.2.10 _sass/unify/tools/mixins/_positions.scss