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

Interpolation in CSS functions doesn't seem to work #246

Closed
LeaVerou opened this issue Jan 12, 2014 · 8 comments
Closed

Interpolation in CSS functions doesn't seem to work #246

LeaVerou opened this issue Jan 12, 2014 · 8 comments

Comments

@LeaVerou
Copy link

Here’s a test input & output that demonstrates the bug:

/* demo.css: */
.selector {
  padding: 0 calc(100%/2 - #{$content-width/2})
}


/* ➜  bin/sassc demo.scss */
.selector {
  padding: 0 calc(100%/2 - #{$content-width/2}); }
@rodneyrehm
Copy link
Contributor

For reference, libsass and sassc were builds from master (9e57bdf)

@akhleung
Copy link

This seems to be restricted to the calc function, which LibSass treats specially because it's supposed to pass the argument through ... I'll update it to treat the argument as an interpolated string.

@akhleung
Copy link

Okay, interpolation should work properly in the calc function now.

@rodneyrehm
Copy link
Contributor

I can confirm the interpolation working fine now.

@benfrain
Copy link

Not sure if this has been sorted as I'm running the most recent Grunt Sass (in turn running from Node-Sass) however interpolation isn't working for me within font-face declarations either. For example, this fails at present:

$font: "../css/fonts/";
@font-face  {
    font-family: 'myfont';
    src: url(#{$font}myfont.eot);
    src: url(#{$font}myfont.eot?#iefix) format('embedded-opentype'),
        url(#{$font}myfont.woff) format('woff'),
        url(#{$font}myfont.ttf) format('truetype'),
        url(#{$font}myfont.svg#myfont) format('svg');
    font-weight: normal;
    font-style: normal;
}

@rodneyrehm
Copy link
Contributor

node-sass is compiled against libsass v1.0.1 - not master.

@akhleung
Copy link

The problem is with url, not the @font-face directive. I'll be looking into url this week.

@akhleung
Copy link

Also, since there are other tickets regarding url (#231, #245), and calc seems to be fixed, I'll go ahead and close this ticket.

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

5 participants