I have the following setup:
gem 'sass-rails', '~> 4.0.0'
gem 'css_splitter', '~> 0.2.0'
config.assets.precompile += %w( jquery-1.7.js application.css application_split2.css )
//= include 'application.css'
I'm having issues with precompiling on heroku. One of the files in application.css.scss has @media queries which fail to parse with the error:
Invalid CSS after "...width: auto; } ": expected selector or at-rule, was "}"
/gems/sprockets-2.10.1/lib/sprockets/context.rb:197:in `block in evaluate'
/gems/sprockets-2.10.1/lib/sprockets/index.rb:94:in `block in build_asset'
/gems/sprockets-2.10.1/lib/sprockets/manifest.rb:211:in `block in find_asset'
/gems/sprockets-2.10.1/lib/sprockets/manifest.rb:119:in `block in compile'
/gems/sprockets-rails-2.0.1/lib/sprockets/rails/task.rb:60:in `block (3 levels) in define'
/gems/sprockets-rails-2.0.1/lib/sprockets/rails/task.rb:59:in `block (2 levels) in define'
Tasks: TOP => assets:precompile
(See full trace by running task with --trace)
If I merge this file's css to another file's media query (essentially having the media query in one place instead of 2) fixes the parse error.
How can I fix this issue, as I want to have the media query in separate locations for separate modules?
P.S: This gem has been great for fixing IE issues and thanks for an awesome job
I would think this might be caused by the known limitation mentionend in the README: https://github.com/zweilove/css_splitter#limitations--known-issues
I would certainly be open for any pull requests that fix this issue. The first step would be to build a test case that recreates the exact issue, so there is a solid path for fixing it.
Looks like there might already be a solution out there #26 Can you try if this works for you?
I tried the solution to #26 but it didn't work. it still failed with
Invalid CSS after "@charset "UTF-8"; ": expected selector or at-rule, was "}"
Can you provide your source stylesheets or better yet create a failing test case in the gem's testing dummy rails app?
@kitwalker12 could you try again, after #35 has been merged to master?
Thanks. The issue is fixed.
Updated to 3.4.9 sass gem helped me at this!