Getting Susy and Compass installed with ruby on rails

匆匆过客 提交于 2019-12-05 21:34:33

I'm on rails 3.2.7 and use Susy (and Compass) like this.

##### Gemfile:
group :assets do
  gem 'sass-rails',   '~> 3.2.3'
  gem 'coffee-rails', '~> 3.2.1'
  gem 'compass-rails'
  gem 'susy', git: "git://github.com/ericam/susy.git"
  gem 'uglifier', '>= 1.0.3'
end

Then I have several different css files. application.css.scss, screen.css.scss and _base.scss.css.

application.css.scss

#### application.css.scss:
@import "screen";
# Here you import your normal .scss files as well, like:
# @import "products";

screen.css.scss

#### screen.css.scss
// ---------------------------------------------------------------------------
// Imports
@import "compass";
@import "base";

/* -------------------------------------------------------------------------*/
/* Layout */
// Here you can add layout styling or whatever... :)

_base.css.scss

// ---------------------------------------------------------------------------
// Imports

@import "susy";

// ---------------------------------------------------------------------------
// Basic Grid

$total-columns  : 12;
$column-width   : 4em;
$gutter-width   : 1em;
$grid-padding   : $gutter-width;

$show-grid-backgrounds  : true;

And that's it. Now you can use Susy in all your scss files that you import in application.css.scss.

I hope it helps you to get started.

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!