Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

DEPRECATION WARNING: Passing null, a non-string value, to unquote() will be an error in future versions of Sass #425

Closed
mvjoyner opened this issue Jan 26, 2015 · 12 comments · Fixed by #477

Comments

@mvjoyner
Copy link

Since Sass 3.4.10 in their change log:

http://sass-lang.com/documentation/file.SASS_CHANGELOG.html

"Passing a non-string value to the unquote() function didn’t do anything useful and is now deprecated. In future, this function will follow its documentation and emit an error if a non-string value is passed."

When using Susy's "@include span()" mixin, sass reports the Deprecation Warning.

Using Susy 2.2.1, Sass 3.4.10.

I don't fully understand why the error(warning - future error) is occurring, but I thought I might just mention it.

@mirisuzanne
Copy link
Member

I can't recreate this with the information given.

Also, looking at the Susy code: there is no mention of unquote() in the main susy files, unless you are using susyone (in which case there is no span() mixin). Susyone only uses unquote() on $from arguments, which should always be strings.

@mvjoyner
Copy link
Author

It looks like I had to dig quite a bit deeper. It appears to be a problem with compass. (Sorry, forgot to mention I'm using compass 1.0.3.

I did the old trial and error and commented things out until I narrowed down what was causing it to spit the warning out.

Eventually I got to Susy's box sizing mixin. (susy-2.2.2/sass/susy/ouput/support/_box-sizing.scss

It checks for existing support of a box-sizing mixin. Compass's box-sizing mixin is probably the first thing it finds.

Compass's box-sizing mixin:

@mixin box-sizing($box-model: $default-box-sizing) {
  $box-model: unquote($box-model);
  @include prefixed-properties(css3-boxsizing, $box-sizing-support-threshold, (box-sizing: $box-model));
}

And there's the unquote(). I guess this will have to be brought up with guys over at compass.

Thanks, been using susy for a while now, it's awesome :D

EDIT: Just for clarification on the trace path, and the mixins I went through.

File: _span.scss,
@include output((box-sizing: $box));

File: _output.scss
@include susy-support($prop, $val);

File: _support.scss
@include susy-box-sizing($val);

File: _box_sizing.scss (in support folder)
@include box-sizing($model)

..then the compass mixin..

@cibulka
Copy link

cibulka commented Jan 30, 2015

Same here, the issue disappeared when I overwrote Compass box-sizing mixin. Thanks, you saved me from a debugging headache (since the error message does not provide any details, such as line number)!

@mvjoyner
Copy link
Author

@cibulka

Thanks for the confirmation, just curious what you changed the box-sizing code to?

@sktzoootech
Copy link

I think what he means by overwrote is overload the box-sizing mixin and write it like the following:

@mixin box-sizing($box-model: $default-box-sizing) {
@include prefixed-properties(css3-boxsizing, $box-sizing-support-threshold, (box-sizing: $box-model));
}

I did a test on one of my project and the warnings were all gone. Obviously instead of using the compass box-sizing mixin, it will use the above mixin.

@sktzoootech
Copy link

Here is a better way of overloading the box-sizing mixin:

@mixin box-sizing($box-model: $default-box-sizing) {
@if type-of($box-model) == string {
$box-model: unquote($box-model);
}
@include prefixed-properties(css3-boxsizing, $box-sizing-support-threshold, (box-sizing: $box-model));
}

I did refactoring on $box-model so that if its a string then it will use unquote otherwise it will ignore it.

@madhuco
Copy link

madhuco commented Feb 2, 2015

I also get the Deprecation Warning. I am not using the mixin box-sizing in my project, but the warning makes reference to it:

    [18:22:17] DEPRECATION WARNING: Passing null, a non-string value, to unquote()
    will be an error in future versions of Sass.
            on line 19 of /Library/Ruby/Gems/2.0.0/gems/compass-core-1.0.3/stylesheets/compass/css3/_box-sizing.scss, in `box-sizing'
            from line 12 of /Library/Ruby/Gems/2.0.0/gems/susy-2.1.3/sass/susy/output/support/_box-sizing.scss, in `susy-box-sizing'
            from line 38 of /Library/Ruby/Gems/2.0.0/gems/susy-2.1.3/sass/susy/output/support/_support.scss, in `susy-support'
            from line 12 of /Library/Ruby/Gems/2.0.0/gems/susy-2.1.3/sass/susy/output/shared/_output.scss, in `output'
            from line 28 of /Library/Ruby/Gems/2.0.0/gems/susy-2.1.3/sass/susy/language/susy/_span.scss, in `span'
            from line 46 of /[ny project]screen.scss

How can I fix it. Because I am not using the box-sizing mixin in the project, I can't follow the solutions posted above in this thread.

@mirisuzanne
Copy link
Member

Certain Susy features require changes to box-sizing, and use the compass mixin by default if it's available. You can turn that off in you Susy settings (see custom box-sizing in the docs).

$susy: (
  use-custom: (
    box-sizing: false,
  ),
);

@mrwokkel
Copy link

mrwokkel commented Feb 4, 2015

I also want to note that the order of import is seems to be important.
When I do:

@import "compass";
#than
@import "susy";

it will not show the deprecation warning.

@cibulka
Copy link

cibulka commented Feb 11, 2015

@mvjoyner: Sorry, I've missed the notification! I kept it very simple:

@mixin box-sizing($value) {
    -moz-box-sizing: $value;
         box-sizing: $value;
}

Deprecation warning went away and overwritten mixin worked as expected.

@mvjoyner
Copy link
Author

Awesome, thanks everyone!

@webmasterpf
Copy link

Can i do an update of Compass gem to fix this issue ?
EDIT: replacing

@include border-box-sizing;

by

@mixin box-sizing($value) {
-moz-box-sizing: $value;
box-sizing: $value;
}

and warning gone.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging a pull request may close this issue.

7 participants