0

I am using Rails 4.1.1. And want to use sass and susy. With help of the following releated item: https://stackoverflow.com/a/26171101/2118999

I have created the following files

directory: app/assets/stylesheets/

      _base.css.scss
      _mixins.css.scss
      application.css.scss
      layout.css.scss

importing files in my scss file;

layout.scc.sccs
  @import "compass";
  @import "susy";
  @import "mixins";
  @import "base";

Content of

application.css.scss
/*
 *
 *= require_tree .
 *= require_self
 */

and if I dont import compass also in my base.css.scss it ist not working

base.css.scss
  @import "compass";

This is how my application.rb looks like:

/config/application.rb

require File.expand_path('../boot', __FILE__)

require 'rails/all'
require 'susy'


Bundler.require(*Rails.groups)

module Trx
  class Application < Rails::Application



  end
end

and this is my gemfile

/Gemfile

gem 'sass-rails', '~> 5.0.0.beta1'
gem 'compass-rails', '~> 2.0.0'
gem 'susy'

I find it strange that compass/susy is not working if I dont explicitly import compass also in my base.css.scss, because one would think that file that is importing my base.css.sccs has already imported compass.

And in my application.rb I have to put the require the 'rails/all' and 'susy' Outside the module, otherwise it wont work. Can anyone explain me whats going on? Just cnat see the logic and it feels like a very fragile construction that will break sometime..

best regards,

Martijn

Community
  • 1
  • 1
MDekker
  • 443
  • 1
  • 4
  • 19
  • I'm not sure I understand what your question is. Is this or is this not currently working for you? If not, what doesn't work? If it's just a matter of why?, it probably has to do with the order they are being loaded. – Donovan Dec 23 '14 at 17:45
  • Hi, It is working. And I changed the order a few times, and it will break when I change stuff. Indeed it is more a question of why, I should @import compass more than once and why my requires only work when i define them outside the module in application.rb. – MDekker Dec 24 '14 at 08:50

0 Answers0