sass / node-sass

:rainbow: Node.js bindings to libsass
https://npmjs.org/package/node-sass
MIT License
8.51k stars 1.32k forks source link

"unquote" causes crash in certain situation #1070

Closed yairEO closed 9 years ago

yairEO commented 9 years ago
$colors : ( yellow : #FFDC00 );
body{ color:lighten(unquote(map-get($colors, yellow)), 5); }

Outputs this error (windows 7):

events.js:85
      throw er; // Unhandled 'error' event
            ^
Error: css\dist\main.scss
  21:13  argument `$color` of `lighten($color, $amount)` must be a color

Backtrace:
        stdin:21, in function `lighten`
        stdin:21
    at options.error (C:\xampp\htdocs\BUILD\node_modules\gulp-sass\node_modules\node-sass\lib\index.js:276:32

This is a valid SCSS code and should be compiled successfully. verified with http://sassmeister.com/


This is being compiled using my GULP setup, and this is the JSON configuration:

"dependencies": {
    "event-stream": "^3.3.1",
    "gulp": "^3.9.0",
    "gulp-combine-media-queries": "^0.2.0",
    "gulp-concat": "^2.6.0",
    "gulp-css-globbing": "^0.1.8",
    "gulp-html-to-json": "^0.1.5",
    "gulp-htmlmin": "^1.1.3",
    "gulp-jshint": "^1.11.2",
    "gulp-minify-css": "^1.2.0",
    "gulp-rename": "~1.2.2",
    "gulp-shell": "^0.4.2",
    "gulp-strip-debug": "^1.0.2",
    "gulp-template-compile": "^1.0.0",
    "gulp-uglify": "^1.2.0",
    "gulp.spritesmith": "^4.0.0",
    "path": "^0.11.14",
    "gulp-watch": "*"
},
"devDependencies": {
    "gulp-util": "^3.0.6",
    "gulp-autoprefixer": "2.3.1",
    "gulp-csso": "^1.0.0",
    "gulp-cssshrink": "^0.1.5",
    "gulp-insert": "^0.5.0",
    "gulp-sass": "^2.0.4"
}
saper commented 9 years ago

This is a problem with libsass, which I think has been fixed in the meantime (but there is no new release yet). I get this

DEPRECATION WARNING: Passing #FFDC00, a non-string value, to unquote()
will be an error in future versions of Sass.
        on line 2 of t.js
body {
  color: #ffe01a; }

Ruby Sass gives the same.

yairEO commented 9 years ago

so what should I do now? I want to be to do such things.. how can one know if this has been fixed or not (on libsass) ? is there any ticket?

saper commented 9 years ago

so what should I do now? I want to be to do such things.. how can one know if this has been fixed or not (on libsass) ? is there any ticket?

If you feel brave you can fetch the newest libsass from git and compile node-sass against it.

xzyfer commented 9 years ago

Fixed in https://github.com/sass/node-sass/pull/1214. Will be in v3.4.0.