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

libsass & bootstrap-sass give error on if statement #506

Closed
michaud opened this issue Jan 21, 2014 · 6 comments
Closed

libsass & bootstrap-sass give error on if statement #506

michaud opened this issue Jan 21, 2014 · 6 comments

Comments

@michaud
Copy link

michaud commented Jan 21, 2014

I am trying to use bootstrap-sass in a Visual studio MVC.NET project with VSWE. VSWE, an addon, uses nodejs & libsass to compile SASS. But it throws an error on the bootstrap-sass code:

\vendor\bootstrap\assets\stylesheets\bootstrap_glyphicons.scss:13: error: non-terminal statement or declaration must end with ';'

This happens in _glyphicons.scss on the if statement:

... src: url(if($bootstrap-sass-asset-helper, twbs-font-path('#{$icon-font-path}#{...

I've been tinkering with it and got a working bit of code. Could somebody validate this change? I don't know ruby so i can't help there but this is the code i'm looking for in SASS _glyphicons.scss (or can i do a pull request for this code?):

//Why do we need to import the variables here? is it because of dependency order?  @import "bootstrap/bootstrap" orders by alphabet?
@import "_variables";

//initializing the path outside of the url will makes us work nice with libsass
$icon-font-url-part : if($bootstrap-sass-asset-helper, twbs-font-path('#{$icon-font-path}#{$icon-font-name}'), #{$icon-font-path}#{$icon-font-name});

  font-family: 'Glyphicons Halflings';
  src: url('#{$icon-font-url-part}.eot');
  src: url('#{$icon-font-url-part}.eot?#iefix') format('embedded-opentype'),
       url('#{$icon-font-url-part}.woff') format('woff'),
       url('#{$icon-font-url-part}.ttf') format('truetype'),
       url('#{$icon-font-url-part}.svg##{$icon-font-svg-id}') format('svg');
@tnguyen14
Copy link

I'm running in a similar issue, where $bootstrap-sass-asset-helper is returning true even if the function twbs-font-path doesn't exist.

This is because twbs-font-path('') evaluates to twbs-font-path("") - notice the single quote becomes double quotes.

So this statement $bootstrap-sass-asset-helper: (twbs-font-path('') != unquote('twbs-font-path("")')) !default; in _variables.scss returns true even if the function twbs-font-path does not exist.

@thomas-mcdonald
Copy link
Member

dupe of #494, libsass doesn't support ifs in urls at the moment

@glebm
Copy link
Member

glebm commented Jan 23, 2014

@tnguyen14 Good news is, @akhleung just added if URLs support to libsass. As for the quotes thing, I've changed them to double quotes to be compatible with both.

@tnguyen14
Copy link

@glebm awesome! thanks so much! I'll pull down the latest commits then. Is it still tagged v3.0.3?

@glebm
Copy link
Member

glebm commented Jan 23, 2014

@tnguyen14 No, the tag is fixed, the next version with this stuff will be 3.1.0, just pull master for now

@josephdpurcell
Copy link

Upgrading node-sass to 0.8.6 fixed this error for me. Package.json:

"node-sass": "0.8.6",

mociepka added a commit to mociepka/python-scss that referenced this issue May 28, 2014
More details on: twbs/bootstrap-sass#506
Now we are using the same libsass version as the node sass.
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

No branches or pull requests

5 participants