vigetlabs / gulp-rails-pipeline

Ditch the Rails Asset Pipeline and roll your own with Gulp
MIT License
646 stars 64 forks source link

Access sass mixins defined in gems #25

Closed jekuno closed 9 years ago

jekuno commented 9 years ago

I used gulp-rails-pipeline to ditch the Rails Asset pipeline of an existing project. Now when running gulp build I get the following error:

gulp-notify: [Compile Error] Error in plugin 'gulp-sass' Message: no mixin named panel

The mixin panel is part of the gem foundation-rails. It is defined in the file foundation/components/panels which I import in /app/assets/stylesheets/application.css.scss:

/*
 * Pull compiled from /public/assets/stylesheets
 *= require global
 */
@import 'foundation/components/panels';

My file /gulp/assets/stylesheets/framework_and_overrides.scss basically is:

.authform form {
  @include panel();
}

How can I solve the gulp-sass error? What is the correct way to access mixins which are provided by a Rails gem from my scss files which are managed by gulp? Thanks! :)

greypants commented 9 years ago

hmmm... You can only access sass mixins from gem installed assets from within the rails asset pipeline/sprockets ecosystem.

You'd have to @import 'foundation/components/panels' in your gulp sass file instead of the sprockets manifest file.

Your best bet is to avoid the using the asset pipeline (which gem installed assets do), and just use foundation manually by downloading it and adding `gulp/assets/stylesheets/foundation'