Sha256: f08b8a5f11a0bd6a3ac915a3c87af83cb12f26dfa7997e08c761db03bee67c28

Contents?: true

Size: 1.95 KB

Versions: 78

Compression:

Stored size: 1.95 KB

Contents

@function _linear-positions-parser($pos) {
  $type: type-of(nth($pos, 1));
  $spec: null;
  $degree: null;
  $side: null;
  $corner: null;
  $length: length($pos);
  // Parse Side and corner positions
  @if ($length > 1) {
    @if nth($pos, 1) == "to" { // Newer syntax
      $side: nth($pos, 2);

      @if $length == 2 { // eg. to top
        // Swap for backwards compatability
        $degree: _position-flipper(nth($pos, 2));
      }
      @else if $length == 3 { // eg. to top left
        $corner: nth($pos, 3);
      }
    }
    @else if $length == 2 { // Older syntax ("top left")
      $side: _position-flipper(nth($pos, 1));
      $corner: _position-flipper(nth($pos, 2));
    }

    @if ("#{$side} #{$corner}" == "left top") or ("#{$side} #{$corner}" == "top left") {
      $degree: _position-flipper(#{$side}) _position-flipper(#{$corner});
    }
    @else if ("#{$side} #{$corner}" == "right top") or ("#{$side} #{$corner}" == "top right") {
      $degree: _position-flipper(#{$side}) _position-flipper(#{$corner});
    }
    @else if ("#{$side} #{$corner}" == "right bottom") or ("#{$side} #{$corner}" == "bottom right") {
      $degree: _position-flipper(#{$side}) _position-flipper(#{$corner});
    }
    @else if ("#{$side} #{$corner}" == "left bottom") or ("#{$side} #{$corner}" == "bottom left") {
      $degree: _position-flipper(#{$side}) _position-flipper(#{$corner});
    }
    $spec: to $side $corner;
  }
  @else if $length == 1 {
    // Swap for backwards compatability
    @if $type == string {
      $degree: $pos;
      $spec: to _position-flipper($pos);
    }
    @else {
      $degree: -270 - $pos; //rotate the gradient opposite from spec
      $spec: $pos;
    }
  }
  $degree: unquote($degree + ",");
  $spec:   unquote($spec + ",");
  @return $degree $spec;
}

@function _position-flipper($pos) {
  @return if($pos == left, right, null)
         if($pos == right, left, null)
         if($pos == top, bottom, null)
         if($pos == bottom, top, null);
}

Version data entries

78 entries across 77 versions & 11 rubygems

Version Path
middleman-core-4.6.0 fixtures/minify-css-app/source/stylesheets/bourbon/helpers/_linear-positions-parser.scss
middleman-core-4.5.1 fixtures/minify-css-app/source/stylesheets/bourbon/helpers/_linear-positions-parser.scss
middleman-core-4.5.0 fixtures/minify-css-app/source/stylesheets/bourbon/helpers/_linear-positions-parser.scss
middleman-core-4.4.3 fixtures/minify-css-app/source/stylesheets/bourbon/helpers/_linear-positions-parser.scss
middleman-core-4.4.2 fixtures/minify-css-app/source/stylesheets/bourbon/helpers/_linear-positions-parser.scss
middleman-core-4.4.0 fixtures/minify-css-app/source/stylesheets/bourbon/helpers/_linear-positions-parser.scss
middleman-core-4.3.11 fixtures/minify-css-app/source/stylesheets/bourbon/helpers/_linear-positions-parser.scss
middleman-core-4.3.10 fixtures/minify-css-app/source/stylesheets/bourbon/helpers/_linear-positions-parser.scss
middleman-core-4.3.8 fixtures/minify-css-app/source/stylesheets/bourbon/helpers/_linear-positions-parser.scss
middleman-core-4.3.7 fixtures/minify-css-app/source/stylesheets/bourbon/helpers/_linear-positions-parser.scss
files.com-1.0.55 docs/vendor/bundle/ruby/2.5.0/gems/middleman-core-4.3.3/fixtures/minify-css-app/source/stylesheets/bourbon/helpers/_linear-positions-parser.scss
middleman-core-4.3.6 fixtures/minify-css-app/source/stylesheets/bourbon/helpers/_linear-positions-parser.scss
middleman-core-4.3.5 fixtures/minify-css-app/source/stylesheets/bourbon/helpers/_linear-positions-parser.scss
middleman-core-4.3.4 fixtures/minify-css-app/source/stylesheets/bourbon/helpers/_linear-positions-parser.scss
middleman-core-4.3.3 fixtures/minify-css-app/source/stylesheets/bourbon/helpers/_linear-positions-parser.scss
middleman-core-4.3.2 fixtures/minify-css-app/source/stylesheets/bourbon/helpers/_linear-positions-parser.scss
middleman-core-4.3.1 fixtures/minify-css-app/source/stylesheets/bourbon/helpers/_linear-positions-parser.scss
middleman-core-4.3.0 fixtures/minify-css-app/source/stylesheets/bourbon/helpers/_linear-positions-parser.scss
middleman-core-4.3.0.rc.4 fixtures/minify-css-app/source/stylesheets/bourbon/helpers/_linear-positions-parser.scss
middleman-core-4.3.0.rc.3 fixtures/minify-css-app/source/stylesheets/bourbon/helpers/_linear-positions-parser.scss