Shopify / shopify-css-import

Add CSS import functionality to Shopify theme development with Grunt.js or Gulp.js
http://shopify.github.io/shopify-css-import
MIT License
83 stars 18 forks source link

Importing from more than one subdir level #19

Open cintacks opened 8 years ago

cintacks commented 8 years ago

Sorry noob question - when my file structure includes more than one level (e.g. css/partials/_file.scss.liquid) that file is not added when gulp is run. The @import url is correct and watch runs correctly but it doesn't update theme.scss.liquid in assets unless the source file is in the top level of /css

So my preferred file structure is this:

/css
  /_partials
      _file.scss.liquid

Rather than:

/css
  _file.scss.liquid

Any help would be greatly appreciated.

cshold commented 8 years ago

The @imports will only work from the top level file on purpose, but should certainly be able to go into deeper folders. For example:

/css
  main.scss.liquid
  /_partials
    _file.scss.liquid

main.scss.liquid:

@import url('partials/_file.scss.liquid');

An @import inside _file.scss.liquid will not work.

cintacks commented 8 years ago

Yeah that's what I'm saying - I did it exactly that way (I'm familiar with @import calls) but for some reason it won't compile anything in a subdir. It's weird because the regex seems right in the Gruntfile?

Right now I'll just work off the css root dir but I thought maybe I'm just crazy and wanted a second set of eyes if you ever had the time/inclination.

andyhoman commented 8 years ago

I can't seem to import files in first-level sub-directories either. I'm using Grunt FWIW.