alexwolfe / Buttons

A CSS button library built using Sass and Compass
http://unicorn-ui.com/buttons/builder/
Other
5.04k stars 864 forks source link

Gulp-sass: error parsing interpolated value #64

Open ronilaukkarinen opened 9 years ago

ronilaukkarinen commented 9 years ago
[21:33:42] gulp-notify: [Error running Gulp] styles failed, check the logs..
[21:33:42] styles error: Error in plugin 'gulp-sass'
Message:
    bower_components/Buttons/scss/types/_longshadow.scss
  21:16  error parsing interpolated value
Details:
    column: 16
    line: 21
    file: /Users/rolle/Projects/dudetest/bower_components/Buttons/scss/types/_longshadow.scss
    status: 1
    messageFormatted: bower_components/Buttons/scss/types/_longshadow.scss
  21:16  error parsing interpolated value

What I'm using:

"bower": "^1.4.1",
"browser-sync": "~2.7.12",
"gulp": "^3.9.0",
"gulp-autoprefixer": "2.3.1",
"gulp-cache": "0.2.10",
"gulp-changed": "^1.2.1",
"gulp-concat": "2.5.2",
"gulp-css-globbing": "^0.1.8",
"gulp-header": "1.2.2",
"gulp-imagemin": "^2.2.1",
"gulp-minify-css": "1.1.6",
"gulp-notify": "^2.2.0",
"gulp-pixrem": "^0.2.3",
"gulp-plumber": "^1.0.1",
"gulp-sass": "^2.0.1",
"gulp-sourcemaps": "^1.5.2",
"gulp-uglify": "1.2.0",
"gulp-util": "^3.0.5",

It works when if I disable Long Shadow Function all together.

noderat commented 9 years ago

I can confirm, it seems it's the

      $values: #{$values}, #{$i}px #{$i}px #{$kolor};

causing the issue. This is a libsass bug and can be found on their bugtracker #1277.

It can be fixed by wrapping in parentheses.

@function longshadowFunc($type, $color, $length, $direction: right) {
  $values: 0px 0px $color;

  //LEFT SHADOW
  @if $direction == right {
    @for $i from 1 through $length {
      $kolor: $color;
      $values: (#{$values}), #{$i}px #{$i}px #{$kolor};
    }
  }

  //RIGHT SHADOW
  @if $direction == left {
    @for $i from 1 through $length {
      $kolor: $color;
      $values: #{$values}, unquote($i * -1 + 'px') #{$i}px #{$kolor};
    }
  }

  @return $values;
}
sunilw commented 9 years ago

Can confirm both the presence of the bug and the resolution of it using moderat's solution.