brunch / sass-brunch

Adds Sass / Scss support to brunch
MIT License
97 stars 104 forks source link

How do I include a compass mixin #10

Closed ddubyah closed 12 years ago

ddubyah commented 12 years ago

Hi there. Sorry if this is a dumb question but I can't work out how to include a compass mixin in my styles. I've tried a variety of paths but I just keep getting this error

@import "compass/css3";

- error: SassCompiler failed in 'app/styles/style.scss' -- Compile error: Syntax error: File to import not found or unreadable: compass/css3.

Could someone please point me in the right direction? Thanks in advance.

paulmillr commented 12 years ago

@import "compass";

paulmillr commented 12 years ago

Is compass/css3 different? (I don’t know any compass). If it is and the functionality cannot be achieved via @import "compass"; then it is a bug.

ddubyah commented 12 years ago

Thanks for the rapid response :)

Nope, that throws the same error.

24 Aug 10:49:04 - error: SassCompiler failed in 'app/styles/style.scss' -- Compile error: Syntax error: File to import not found or unreadable: compass.
              Load paths:
                /Users/wallace/wip/Workspace/brunch/todos
                /Users/wallace/wip/Workspace/brunch/todos
                /Users/wallace/wip/Workspace/brunch/todos/app/styles
        on line 7 of standard input

Maybe there's a way to add to the listed load paths? Could probably point that to your installed compass stuff?

paulmillr commented 12 years ago

strange.

It should do stuff automatically.

Can you clone the repo, run npm install in its dir and then npm test and check if tests are passing?

Then edit L43 of test and add after it @import 'compass'\n\ and check again?

As you can see, it should have been filtered here

ddubyah commented 12 years ago

Yeah, all the tests pass. Doh!

paulmillr commented 12 years ago

Maybe your compass is broken (or sass)?

ddubyah commented 12 years ago

Maybe. It relys on the ruby gems, and their associated paths right? I do use RVM, so maybe something's gone snafu there.

paulmillr commented 12 years ago

yep

ddubyah commented 12 years ago

So far no luck. I've installed compass in the system gemset (as opposed to through RVM) and tested it all works fine. But still no luck getting sass-brunch to use compass mixins.

It's worth noting that our dev team is a mix of Windows and Mac users. Sass-brunch works fine with Compass on our Windows machines, but not on any of our Macs (some using RVM, some using system Ruby).

This feels like a straight forward pathing issue. But I'm new to Node and the solution seems a little beyond me. Like, what is the purpose of line 66. It seems to be filtering out paths with Compass in it? Sorry to be such a newb, but could do with a point in the right direction.

I'd like to take a stab at fixing this if need be. We're currently having to compile our stylesheets in a separate project from our Backbone app.

ddubyah commented 12 years ago

So sorry, it was indeed a problem with my compass set up and my use of RVM and ZShell.

I think the problem lay with my use of ZShell and the fact that it forced bundle exec before every gem command. So since I hadn't set up a Gemfile for my brunch project, I think it screwed up the reference to my compass gem.

Whatever the reason, solution was to add a Gemfile to my project and add sass and compass dependencies to it. All seems fine now.