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

Variable not expanded in url() #1370

Closed
saper opened this issue Jul 22, 2015 · 8 comments
Closed

Variable not expanded in url() #1370

saper opened this issue Jul 22, 2015 · 8 comments

Comments

@saper
Copy link
Member

saper commented Jul 22, 2015

Example code from sass/node-sass#1042 reported by @chenxiaochun

@mixin ico-common($imgUrl){
    display: inline-block;
    background: url(i/$imgUrl);
    background-repeat: no-repeat;
}

@mixin ico-size($width,$height){
    width: $width;
    height: $height;
}

.test{
    @include ico-common("icon.png");

    @include ico-size(100px, 100px);
}

Ruby Sass output (sass/sass@b4bbd96):

.test {
  display: inline-block;
  background: url(i/"icon.png");
  background-repeat: no-repeat;
  width: 100px;
  height: 100px; }

libsass output as of 3.2.5-111-g5e94 (saper@5e9437b):

.test {
  display: inline-block;
  background: url(i/$imgUrl);
  background-repeat: no-repeat;
  width: 100px;
  height: 100px; }

not sure how useful is url(i/"something.ico") output, but that is what Ruby is doing.

If the Ruby Sass behaviour is undesired, please file an issue at https://github.com/sass/sass/issues

@chenxiaochun
Copy link

I am sorry it's my mistake.
It should't has the double quotation mark. But removed, the Ruby Sass will throw exception.

@saper
Copy link
Member Author

saper commented Jul 22, 2015

so, can we close this?

@chenxiaochun
Copy link

OK, thank you very much.

@saper saper closed this as completed Jul 22, 2015
@saper
Copy link
Member Author

saper commented Jul 27, 2015

@xzyfer I wonder if this expansion issue is a duplicate of some other issue we already have? Or this a new thing and should be kept open?

@xzyfer
Copy link
Contributor

xzyfer commented Jul 27, 2015

Our url() has some big issues. I'm not sure how defined the behaviour exhibited above is but it's probably worth tracking. I'm not aware of a duplicate to this issue.

@mgreter
Copy link
Contributor

mgreter commented Aug 23, 2015

With #1477 it renders now:

.test {
  display: inline-block;
  background: url(i/icon.png);
  background-repeat: no-repeat;
  width: 100px;
  height: 100px; }

@xzyfer
Copy link
Contributor

xzyfer commented Aug 24, 2015

#1477 addresses the failing interpolation but incorrectly produces an unquote string. This will be addressed in the near future.

@xzyfer
Copy link
Contributor

xzyfer commented Aug 24, 2015

The incorrect quoting is being tracked in #1480

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

No branches or pull requests

4 participants