SASS load path?

Putting this in my application.css.scss does not load the sass library.

@import ‘foundation.scss’;

Even if I put this in my config.

config.sass.load_paths << Rails.root.join( ‘vendor’, ‘assets’, ‘components’, ‘foundation-sites’, ‘scss’ )

Thanks.

Hey Justin,

  • The extension isn’t necessary for the @import (‘foundation’ should work just fine)
  • The error should include the sass load paths. You’ll see that Rails looks in some specific folders under vendor/assets. For sass, the convention is to put your sass/scss files under vendor/assets/stylesheets (you can add subfolders in here without additional configuration). If you decide to move your components folder there, you don’t need the sass.load_paths config.
  • If you still want to load your scss file from vendor/assets/components, you can add it to the sass load paths (as you’ve done), and that should work after a server restart. Is your foundation.scss file in vendor/assets/components/foundation-sites/scss? Jim

I can probably put it anywhere, but I’m using bower to manage js/css/scss. Going by an article is how I decided on components folder. Seems nice and clean that way, but I’m open to better options. Yes the scss is in that folder it’s called foundation.scss. No underscore in file name. Yes I restarted. However now that you mention the error, there is no error. There’s just no css in the application.css file it creates. And the clear fact there’s no style. :slight_smile: The foundation.scss just has a bunch of includes. Here’s a sample.

/ Sass utilities

@import ‘util/util’;

// Global variables and styles

@import ‘global’;

// Components

@import ‘grid/grid’;

@import ‘typography/typography’;

@import ‘forms/forms’;

@import ‘components/visibility’;

@import ‘components/float’;

@import ‘components/button’;

@import ‘components/button-group’;

@import ‘components/accordion-menu’;

Ya it appears to pull in the foundation.scss file, but none of the imports in that file.

Interesting. Have you tried clearing Rails’ tmp files with rake tmp:clear? I’ve seen that clear up weird asset-related issues.

If that doesn’t work, would it be possible to push your app to GitHub or somewhere public so I could take a look? If the code is private, you could potentially create a fresh rails app with a minimal example of your problem (just your bower set up with application.scss importing foundation.scss - the minimal case might even shed light on the problem itself).

I created a new app and setup bower with it. Added to load path. It does the same. Loads the specific file, but that loaded files imports do not load.

OMG I’m just stupid. I just figured out what my issue is. All is working fine, I just forgot to use the includes. Geez. Sorry for the waste of time, and thanks for helping out.

No problem - glad you got it worked out!