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

foundation new project fails to compile correctly with compass 1.0.0 #5636

Closed
rossbayer opened this issue Aug 19, 2014 · 27 comments
Closed

foundation new project fails to compile correctly with compass 1.0.0 #5636

rossbayer opened this issue Aug 19, 2014 · 27 comments
Assignees
Labels
Milestone

Comments

@rossbayer
Copy link

If a user follows the steps outlined at http://foundation.zurb.com/docs/sass.html and then uses compass as opposed to libsass, the compile will succeed but the only content that will be included in the generated CSS file will be from foundation/components/_visibility.scss. This is with compass 1.0.0 and sass 3.4.0 (both the latest versions from rubygems.org).

After some investigation, the problem is with the exports mixin on line 11 of _functions.scss. First, the index function returns null, not false, so the comparison is invalid. Second, the !global keyword needs to be used with the append call in order for the $modules reference to be properly scoped. Here is what the mixin should look like for Compass 1/Sass 3.4:

$modules: () !default;
@mixin exports($name) {
  @if(not index($modules, $name)) {
    $modules: append($modules, $name) !global;
    @content;
  }
}

If desired, I can submit a pull request for this. I didn't just because I don't know how the above will affect compilation with libsass (could not find anywhere what version of Ruby Sass they are compatible with).

Steps to reproduce issue:

$ gem install foundation
$ foundation new testproject
$ gem install compass -v 1.0.0 
$ compass compile

After executing the above, look as stylesheets/app.css and observe that almost all content is missing from the generated file.

@noeljackson
Copy link
Contributor

There is already a PR that was not merged, however, I notice the fix no longer breaks libsass per this: sass/libsass#409

@SalahAdDin
Copy link

Very interesting!

@mafrosis
Copy link
Contributor

I hit this one upgrading from Foundation 4 -> 5 today. Hacking in the changes from #5632 fixed my build.

@jspradlin
Copy link

If you follow the instructions above with compass 1.0.1, I did not see the errors, however most of foundation does not make it to the output app.css.

@myinitialsaretk
Copy link

@mafrosis Thanks, that fix worked.

@mcmullengreg
Copy link

I've tried working through a variety of fixes and haven't had any luck with getting compass to compile. The best I've gotten is type and visibility. Any ideas as to what happened, I just setup a new project less than a week ago and it worked great. Now I can't get a new project to work at all.

@mafrosis
Copy link
Contributor

@mcmullengreg I suggest you check/upgrade your compass and sass versions, and then apply the manual hack from #5632 (which won't be needed when foundation is updated)

> compass -v
Compass 1.0.1 (Polaris)
Copyright (c) 2008-2014 Chris Eppstein
Released under the MIT License.
Compass is charityware.
Please make a tax deductable donation for a worthy cause: http://umdf.org/compass
> sass -v
Sass 3.4.0 (Selective Steve)

@mcmullengreg
Copy link

I have those versions on my work MacBook but am still running 3.3.1 and 0.12.6 at home. Which is nice since those versions still work (for me) currently. I'll keep an eye out for the updates in the coming days (at work).

Thanks @mafrosis

@michaelworm
Copy link

Please implement this fix and push it to Foundation 5.3.4. We need this immediately so we don't have to patch everyone's Foundation Version for ourselves.

@duffyjp
Copy link

duffyjp commented Aug 22, 2014

Foundation 5.4 didn't fix this for me.

@duffyjp
Copy link

duffyjp commented Aug 22, 2014

UPDATE: Reverting from sass 3.4 to 3.2.19 eliminated the problem for me. Using Foundation 5.4 still.

@createproblem
Copy link

👍

@Sureiya
Copy link

Sureiya commented Aug 23, 2014

The problem with this for me is that it was silently failing. I've been pulling my hair out for days trying to figure out what was causing it. Anyone know how to get things like this to not silently fail in the future?

@noeljackson
Copy link
Contributor

I've found that this fix works and does not fail silently. #5651 It's just a slight bit different from what @rossbayer proposed.

@rafibomb
Copy link
Member

An older version of Compass tested .12 worked fine today. Newer Compass versions are causing the issue. We are looking into why.

@rafibomb rafibomb added the scss label Aug 25, 2014
@rafibomb rafibomb added this to the 5.4.1 milestone Aug 25, 2014
@rafibomb rafibomb modified the milestones: 5.4.1, 5.4.1 Week 1 Aug 25, 2014
@oblivious87
Copy link

What @rossbayer did in #5651 fixed the issue. Thanks @noeljackson for pointing that out.

@philipandersson
Copy link

@duffyjp What version of Compass are you using?

@duffyjp
Copy link

duffyjp commented Aug 28, 2014

@Phillys 0.12.7

@chillichicken
Copy link

When I follow the instructions on http://foundation.zurb.com/docs/sass.html#nocli I get delivered an unstable and apparently untested version of the sass components. (Not mentioning the time I spent to find this..)

Why isn't the documentation website pointing to a stable release branch ?

I never have such issues with twitter bootstrap.

@ghost
Copy link

ghost commented Sep 3, 2014

Thank you for the fix!

I curious why this did not throw an error while compiling?

@tvollstaedt
Copy link

I've been looking for this for days now. The simplest solution is to adjust compass/sass dependencies so foundation only pulls compatible API's. Please do this ASAP so we can continue using a clean codebase (patching libraries is a no-go).

@mjatharvest Because i'ts just an if-statement that returns a false instead of true.

BTW, this API-breaking change was introduced 7 months ago: sass/sass@79bad1f
This should really be a hotfix, not a milestone release.

@gakimball
Copy link
Contributor

We merged in #5651 to get our codebase working with Sass 3.4 and Compass 1.0. We're also now compiling our docs with Ruby Sass instead of libsass, but the small changes we made to the codebase shouldn't break libsass compatibility.

@Jezfx
Copy link

Jezfx commented Sep 6, 2014

Thank you for this fix!!

smartperson added a commit to smartperson/foundation-rails that referenced this issue Sep 15, 2014
This is tied to issues mentioned in:
http://foundation.zurb.com/forum/posts/18856-sass-342-compilation-proble
m
sass/sass#1397
foundation/foundation-sites#5636
foundation/foundation-sites#5632

Since it seems to be taking time for smarter minds to come up with
changes to Foundation 5 that will get it playing nice with sass 3.4,
let’s at least modify the dependencies in the meantime so more users
don’t update their gems and spend forever debugging a very unusual
issue.
@sebastiansulinski
Copy link

You're a live saver - I've updated compass two days ago and already had to re-do one project - now I just had to amend one scss component for another project which was using Foundation 5.3.3 and same happend - the _functions.scss suggestion fixed it for me.

@marketingpartnersau
Copy link

AMAZING. This drove me nuts for several days.

@thenikso
Copy link

Why is this closed? I'm still having this issue with latest version of compass (or sass) and foundation. @rossbayer fix in the first post works for me too

@gakimball
Copy link
Contributor

We had to roll back Sass 3.4 support temporarily to maintain support with Sass 3.2, required for Rails users, and libsass, which is used by an increasingly large number of folks. In a few weeks we're going to actually push forward the codebase whether sass-rails, still hardcoded to 3.2, has caught up or not.

This has been something of an ongoing saga; if you're interesting in reading a little bit about it, Bryan Jones, the creator of CodeKit, wrote a pretty great overview of the whole situation. We're trying to juggle compatibility with four versions of Sass (now five with libsass 3.0 out last week).

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

No branches or pull requests