Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

getting error after ugrading to sass-3.1.8

after upgrading to sass-3.1.8 form sass-3.1.7 I get this error:

 Functions may only be defined at the root of a document.

any Idea how I can solve this?

I'm using some of bourbon's mixins and it's imported at the top of my stylesheets, that's all.

like image 223
Allen Bargi Avatar asked Sep 30 '11 22:09

Allen Bargi


3 Answers

I have the same problem and could not solve it by modifying code.

The way I solved was to use an older version:

gem uninstall sass
gem install sass -v 3.1.1
like image 183
Tower Avatar answered Nov 20 '22 16:11

Tower


Ok Here is what I come up with:

SASS team decided to make a change (in this case "Functions may only be defined at the root of a document.") that made some plugins incompatible. in my case it was bourbon library. I made a ticket on github homepage of the bourbon and the owner updated the code and released a new version that's working with latest api.

I think this change should have got a bigger version bump to indicate the api change.

like image 1
Allen Bargi Avatar answered Nov 20 '22 16:11

Allen Bargi


Sass developer here. Mixins and functions were never meant to be allowed in a scoped context. A bug was fixed recently that caused them to be caught when in an imported file (before this fix they were only caught if defined in the primary sass file).

That said, it's not a feature we're explicitly opposed to, but we'd would need to properly test it, document it, and support it as an official feature.

like image 1
chriseppstein Avatar answered Nov 20 '22 14:11

chriseppstein