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

function interpolation in url() doesn't work #1438

Closed
hyunchulkwak opened this issue Aug 12, 2015 · 3 comments
Closed

function interpolation in url() doesn't work #1438

hyunchulkwak opened this issue Aug 12, 2015 · 3 comments

Comments

@hyunchulkwak
Copy link

This might be an edge case but works fine on ruby sass.

input

// okay
.plain-url {
  background-image: url(../test.png);  
}

// okay
.url-with-parameters {
  background-image: url(../test.png?v=20150812);
}

// example function returns param number
@function test(){
  @return 20150812;
}

// doesn't work
// error reading values after ( on line 23 at column 24
.url-with-function-interpolation-without-quotes {
  background-image: url(../test.png?v=#{test()});
}

// workaround
.url-with-function-interpolation-using-quotes {
  background-image: url("../test.png?v=#{test()}");
}

output: libsass (v3.2.5)

error reading values after ( on line 23 at column 24

output: ruby-sass (v3.4.14)

.plain-url {
  background-image: url(../test.png);
}

.url-with-parameters {
  background-image: url(../test.png?v=20150812);
}

.url-with-function-interpolation-without-quotes {
  background-image: url(../test.png?v=20150812);
}

.url-with-function-interpolation-using-quotes {
  background-image: url("../test.png?v=20150812");
}
@xzyfer
Copy link
Contributor

xzyfer commented Aug 17, 2015

Thanks @hyunchulkwak. I can confirmed this is fixed on master and will be 3.3

@xzyfer xzyfer closed this as completed Aug 17, 2015
xzyfer added a commit to xzyfer/sass-spec that referenced this issue Aug 17, 2015
@xzyfer
Copy link
Contributor

xzyfer commented Aug 17, 2015

I thought this was an interesting usecase, and I know we have work on the url function coming up so I added a spec sass/sass-spec#474

@xzyfer xzyfer added this to the 3.3 milestone Aug 17, 2015
@hyunchulkwak
Copy link
Author

thanks @xzyfer

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

3 participants