Closed migreyes closed 11 years ago
Looks as if it defaults to searching within "_includes." Placing stylesheets I'd like to import into here allows it to work.
I just compiled my blog, which uses @import
to incude several other *.scss files that share variables without any issue. Here are the entire contents of my master stylesheet:
@import '_assets/stylesheets/global.css.scss';
@import '_assets/stylesheets/layouts/default.css.scss';
@import '_assets/stylesheets/layouts/post.css.scss';
@import '_assets/stylesheets/includes/recent_posts.css.scss';
@import '_assets/stylesheets/articles.css.scss';
Is this not what you are trying to do?
Ah, I see. You're prepending the full path before the stylesheet. The Sass @import directive usually lets you trim it down, where this works so long as mixins.scss is in the same directory as the stylesheet from where you're calling it:
@import 'mixins';
Not a real issue, we can close this one.
Good deal. Let me know if you have any other issues!
Just for the record, I used a slightly cleaner version of the above for my own site. In jekyll_asset_pipeline.rb
I use the following:
return Sass::Engine.new(@content, syntax: :scss, load_paths: ['../_assets']).render
Note the load_paths. This allows me to use the following when importing:
@import "css/style"; // imports _assets/css/_style.scss
My assets are stored in /_assets
and i'm using the following in the convert method:
return Sass::Engine.new(@content, syntax: :scss, load_paths: ['./_assets/']).render
with the following import statement:
@import 'variables';
the variables
file has the following name _variables.css.scss
within the _assets
directory
Still getting the error below though...
$ jekyll serve --watch
Configuration file: /Users/mattmessinger/bigframe/repos/viewfinder/_config.yml
Source: /Users/mattmessinger/bigframe/repos/viewfinder
Destination: /Users/mattmessinger/bigframe/repos/viewfinder/_site
Generating... Asset Pipeline: Processing 'css_asset_tag' manifest 'global'
Failed to convert asset 'styles.css.scss'.
Asset Pipeline: Failed to convert 'styles.css.scss' with 'JekyllAssetPipeline::SassConverter'.
Liquid Exception: File to import not found or unreadable: variables. Load paths: /Users/mattmessinger/bigframe/repos/viewfinder/_assets /Users/mattmessinger/.rvm/gems/ruby-2.0.0-p0/gems/compass-0.12.2/frameworks/blueprint/stylesheets /Users/mattmessinger/.rvm/gems/ruby-2.0.0-p0/gems/compass-0.12.2/frameworks/compass/stylesheets Compass::SpriteImporter in _includes/header.html
error: File to import not found or unreadable: variables.
Load paths:
/Users/mattmessinger/bigframe/repos/viewfinder/_assets
/Users/mattmessinger/.rvm/gems/ruby-2.0.0-p0/gems/compass-0.12.2/frameworks/blueprint/stylesheets
/Users/mattmessinger/.rvm/gems/ruby-2.0.0-p0/gems/compass-0.12.2/frameworks/compass/stylesheets
Compass::SpriteImporter. Use --trace to view backtrace
Hey Matt,
Nice work on this. In building out a new site, I'm noticing that the Asset Pipeline fails once there's an
@import
at the top of any stylesheet.(I'm pulling in a
mixins
andreset
file, both of which are currently empty. I can of course stack all of my styles in one stylesheet, but processing multiple sheets is ideal.)