Using susy in Rails 4.1.1

125 Views Asked by At

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

0

There are 0 best solutions below