From: Tomas Sedovic tsedovic@redhat.com
--- src/app/stylesheets/grid.scss | 32 ++++++++++++++++++++++++++++++++ src/app/stylesheets/text.scss | 8 ++++++++ src/app/views/layouts/aggregator.haml | 2 ++ src/config/compass.rb | 2 ++ src/config/environment.rb | 1 + src/config/initializers/compass.rb | 6 ++---- 6 files changed, 47 insertions(+), 4 deletions(-) create mode 100644 src/app/stylesheets/grid.scss create mode 100644 src/app/stylesheets/text.scss
diff --git a/src/app/stylesheets/grid.scss b/src/app/stylesheets/grid.scss new file mode 100644 index 0000000..bb3305f --- /dev/null +++ b/src/app/stylesheets/grid.scss @@ -0,0 +1,32 @@ +/* 960 Grid System ~ Core CSS. + * Learn more ~ http://960.gs/ + * * + * Licensed under GPL and MIT. */ + +@import "compass/reset"; +@import "960/grid"; + +// The following generates the default grids provided by the css version of 960.gs +.container_12 { + @include grid-system(12); } + +.container_16 { + @include grid-system(16); } + +// But most compass users prefer to construct semantic layouts like so (two column layout with header and footer): + +$ninesixty-columns: 24; + +.two-column { + @include grid-container; + #header, + #footer, + #sidebar, + #main-content { + @include grid-unit-base; } + #header, #footer { + @include grid-width(24); } + #sidebar { + @include grid-width(8); } + #main-content { + @include grid-width(16); } } diff --git a/src/app/stylesheets/text.scss b/src/app/stylesheets/text.scss new file mode 100644 index 0000000..6cbabe7 --- /dev/null +++ b/src/app/stylesheets/text.scss @@ -0,0 +1,8 @@ +/* 960 Grid System ~ Text CSS. + * Learn more ~ http://960.gs/ + * * + * Licensed under GPL and MIT. */ + +@import "960/text"; + +@include text; diff --git a/src/app/views/layouts/aggregator.haml b/src/app/views/layouts/aggregator.haml index 7384cf0..b9fd4df 100644 --- a/src/app/views/layouts/aggregator.haml +++ b/src/app/views/layouts/aggregator.haml @@ -6,6 +6,8 @@ Deltacloud = yield :title
+ = stylesheet_link_tag 'compiled/grid.css', :media => 'screen, projection' + = stylesheet_link_tag 'compiled/text.css', :media => 'screen, projection' = stylesheet_link_tag 'compiled/screen.css', :media => 'screen, projection' = stylesheet_link_tag 'compiled/layout' = stylesheet_link_tag 'compiled/components' diff --git a/src/config/compass.rb b/src/config/compass.rb index 3e772ab..985bb3a 100644 --- a/src/config/compass.rb +++ b/src/config/compass.rb @@ -1,5 +1,7 @@ # This configuration file works with both the Compass command line tool and within Rails. # Require any additional compass plugins here. +require 'ninesixty' + project_type = :rails project_path = Compass::AppIntegration::Rails.root # Set this to the root of your project when deployed: diff --git a/src/config/environment.rb b/src/config/environment.rb index 7863031..9158d40 100644 --- a/src/config/environment.rb +++ b/src/config/environment.rb @@ -51,6 +51,7 @@ Rails::Initializer.run do |config| config.gem "gnuplot" config.gem "scruffy" config.gem "compass", :version => ">= 0.10.2" + config.gem "compass-960-plugin", :lib => "ninesixty"
config.active_record.observers = :instance_observer, :task_observer # Only load the plugins named here, in the order given. By default, all plugins diff --git a/src/config/initializers/compass.rb b/src/config/initializers/compass.rb index 4375914..6811b32 100644 --- a/src/config/initializers/compass.rb +++ b/src/config/initializers/compass.rb @@ -1,5 +1,3 @@ require 'compass' -rails_root = (defined?(Rails) ? Rails.root : RAILS_ROOT).to_s -Compass.add_project_configuration(File.join(rails_root, "config", "compass.rb")) -Compass.configure_sass_plugin! -Compass.handle_configuration_change! +require 'compass/app_integration/rails' +Compass::AppIntegration::Rails.initialize!