sprockets icon indicating copy to clipboard operation
sprockets copied to clipboard

@import not working with sassc/scssc processor for gem libraries

Open dagi3d opened this issue 9 years ago • 2 comments

The @import directive is not working if I try to load a stylesheet from a gem using the sassc/scssc processor:

application.scss: @import 'bootstrap';

asset_pipeline.rb:

Sprockets::Helpers.configure do |config|
  require 'sprockets/sassc_processor'
  assets.register_transformer 'text/scss', 'text/css', Sprockets::ScsscProcessor.new

I get this error:

Error: File to import not found or unreadable: bootstrap 

If I just leave the default processor, it works. On the other hand, I found a workaround to make it work by setting an additional asset_path:

assets.append_path(File.join(Gem::Specification.find_by_name('bootstrap-sass').gem_dir, 'assets/stylesheets')

dagi3d avatar Jun 26 '16 21:06 dagi3d

I'm currently working on sassc support. There's some bugs. Right now i'm trying to get sassc-rails working with sprockets 4 https://github.com/sass/sassc-rails/pull/65 after that i'm looking to get the SasscProcessor working and then hopefully get sass-rails to auto default to sassc when it's present and Sprockets 4 is being used. I don't have a timeline for those fixes but that's the gameplan.

schneems avatar Jun 27 '16 15:06 schneems

I never fixed sassc, i think it's not going to ship with sprockets 4. No clue what's wrong. In the mean time you can use the sassc-rails gem.

schneems avatar Nov 17 '17 16:11 schneems