Welcome to the Treehouse Community

Want to collaborate on code errors? Have bugs you need feedback on? Looking for an extra set of eyes on your latest project? Get support with fellow developers, designers, and programmers of all backgrounds and skill levels here with the Treehouse Community! While you're at it, check out some resources Treehouse students have shared here.

Looking to learn something new?

Treehouse offers a seven day free trial for new students. Get access to thousands of hours of content and join thousands of Treehouse students and alumni in the community today.

Start your free trial

CSS

Jitendra Vyas
Jitendra Vyas
2,349 Points

Sass::SyntaxError: Undefined mixin 'mixin_name'

I'm working on a Rails 4 project where I'm using Sass and Sass's @import to combine multiple css into one. It works fine but not if I use a new partial for mixins (_mixins.css.scss) and @import this in main.css.scss only and use mixins any other file which is added after that _webapp.css.scss

@import "bootstrap/bootstrap";
@import "responsive/mega_menu";
@import "responsive/mixins";
@import "responsive/webapp";

Rails Precompilation process is unable to found "responsive/mixins" and gives error in _webapp.css.scss

Sass::SyntaxError: Undefined mixin 'mixin_name'. here mixin_name is defined in responsive/mixins

1 Answer

The order of your imports might be the problem. If "responsive/mega_menu" is calling for that mixin(mixin_name) then you're going to get an error.

Jitendra Vyas
Jitendra Vyas
2,349 Points

That is not the problem in my case.