compass-themes 0.0.1

Sign up to get free protection for your applications and to get access to all the features.
data/.document ADDED
@@ -0,0 +1,5 @@
1
+ lib/**/*.rb
2
+ bin/*
3
+ -
4
+ features/**/*.feature
5
+ LICENSE.txt
data/.gitignore ADDED
@@ -0,0 +1,46 @@
1
+ # rcov generated
2
+ coverage
3
+
4
+ # rdoc generated
5
+ rdoc
6
+
7
+ # yard generated
8
+ doc
9
+ .yardoc
10
+
11
+ # bundler
12
+ .bundle
13
+
14
+ # jeweler generated
15
+ pkg
16
+
17
+ # Have editor/IDE/OS specific files you need to ignore? Consider using a global gitignore:
18
+ #
19
+ # * Create a file at ~/.gitignore
20
+ # * Include files you want ignored
21
+ # * Run: git config --global core.excludesfile ~/.gitignore
22
+ #
23
+ # After doing this, these files will be ignored in all your git projects,
24
+ # saving you from having to 'pollute' every project you touch with them
25
+ #
26
+ # Not sure what to needs to be ignored for particular editors/OSes? Here's some ideas to get you started. (Remember, remove the leading # of the line)
27
+ #
28
+ # For MacOS:
29
+ #
30
+ .DS_Store
31
+ #
32
+ # For TextMate
33
+ *.tmproj
34
+ #tmtags
35
+ #
36
+ # For emacs:
37
+ #*~
38
+ #\#*
39
+ #.\#*
40
+ #
41
+ # For vim:
42
+ #*.swp
43
+
44
+
45
+ *.gem
46
+ Gemfile.lock
data/Gemfile ADDED
@@ -0,0 +1,20 @@
1
+ source "http://rubygems.org"
2
+ # Add dependencies required to use your gem here.
3
+ # Example:
4
+ # gem "activesupport", ">= 2.3.5"
5
+
6
+ # Add dependencies to develop your gem here.
7
+ # Include everything needed to run rake, tests, features, etc.
8
+
9
+ gem "compass", ">= 0.11.beta.1"
10
+
11
+ group :development do
12
+ gem "shoulda", ">= 0"
13
+ gem "bundler", "~> 1.0.0"
14
+ gem "rcov", ">= 0"
15
+ gem "rspec", "~>2.0.0"
16
+ gem 'mocha'
17
+ gem 'cucumber'
18
+ gem 'rails', '~> 3.0.0'
19
+ end
20
+
data/LICENSE.txt ADDED
@@ -0,0 +1,20 @@
1
+ Copyright (c) 2011 Scott Davis
2
+
3
+ Permission is hereby granted, free of charge, to any person obtaining
4
+ a copy of this software and associated documentation files (the
5
+ "Software"), to deal in the Software without restriction, including
6
+ without limitation the rights to use, copy, modify, merge, publish,
7
+ distribute, sublicense, and/or sell copies of the Software, and to
8
+ permit persons to whom the Software is furnished to do so, subject to
9
+ the following conditions:
10
+
11
+ The above copyright notice and this permission notice shall be
12
+ included in all copies or substantial portions of the Software.
13
+
14
+ THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
15
+ EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
16
+ MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
17
+ NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE
18
+ LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION
19
+ OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION
20
+ WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
data/README.mdown ADDED
@@ -0,0 +1,51 @@
1
+ # Compass Themes
2
+
3
+ Compass Themes is a theme system using the [compass framework](http://compass-style.org)
4
+
5
+ The goal of compass themes is to provide an out of the box solution for basic design templates for your applications.
6
+
7
+ No more small applications without designs!
8
+
9
+ Rails 3 is only supported at the moment but rake tasks are on there way for other setups
10
+
11
+ ## Usage
12
+
13
+ For now until I'm ready to release a version in your Gemfile
14
+ gem 'compass-themes', :git => 'git://github.com/jetviper21/compass-themes.git'
15
+
16
+ `rake compass:themes` will list all themes available
17
+
18
+ To Install a theme
19
+ rails g compass_theme <layout>/<theme>
20
+ Example:
21
+ rails g compass_theme basic/railscast
22
+
23
+ ## Contributing to Compass Themes
24
+
25
+ * Check out the latest master to make sure the feature hasn't been implemented or the bug hasn't been fixed yet
26
+ * Check out the issue tracker to make sure someone already hasn't requested it and/or contributed it
27
+ * Fork the project
28
+ * Start a feature/bugfix branch
29
+ * Commit and push until you are happy with your contribution
30
+ * Make sure to add tests for it. This is important so I don't break it in a future version unintentionally.
31
+ * Please try not to mess with the Rakefile, version, or history. If you want to have your own version, or is otherwise necessary, that is fine, but please isolate to its own commit so I can cherry-pick around it.
32
+
33
+ ### Creating Themes
34
+
35
+ * Themes consist of a layout file in `lib/compass-themes/templates/`
36
+ * Sass or Scss for a layout is stored in `lib/compass-themes/stylesheets/<layout>.theme.s(css|ass)/`
37
+ * Stylesheets that are not the base stylesheet for a theme need to be have the suffix `theme.scss` in order to be seen by the installation tools
38
+ * Its perfectly ok to have one stylesheet per layout
39
+
40
+ ## Aurthor
41
+
42
+ Compass Themes is written by [Scott Davis](http://sdavis.info)
43
+
44
+ Scott is a Developer for the Space Telescope Science Institute in Baltimore, MD - [Hubble Space Telescope](http://hubblesite.org)
45
+
46
+ [Twitter](http://twitter.com/jetviper21)
47
+
48
+ ## Copyright
49
+
50
+ Copyright (c) 2011 Scott Davis. See LICENSE.txt for further details.
51
+
data/Rakefile ADDED
@@ -0,0 +1,30 @@
1
+ require 'rubygems'
2
+ require 'bundler'
3
+ begin
4
+ Bundler.setup(:development)
5
+ rescue Bundler::BundlerError => e
6
+ $stderr.puts e.message
7
+ $stderr.puts "Run `bundle install` to install missing gems"
8
+ exit e.status_code
9
+ end
10
+ require 'rake'
11
+
12
+
13
+ require 'rspec/core/rake_task'
14
+
15
+ desc 'Default: run specs.'
16
+ task :default => :spec
17
+
18
+ desc "Run specs"
19
+ RSpec::Core::RakeTask.new do |t|
20
+ t.pattern = "./spec/**/*_spec.rb" # don't need this, it's default.
21
+ # Put spec opts in a file named .rspec in root
22
+ t.rspec_opts = ["--color", "--format s"]
23
+ end
24
+
25
+ desc "Generate code coverage"
26
+ RSpec::Core::RakeTask.new(:coverage) do |t|
27
+ t.pattern = "./spec/**/*_spec.rb" # don't need this, it's default.
28
+ t.rcov = true
29
+ t.rcov_opts = ['--exclude', 'spec']
30
+ end
data/TODO.mdown ADDED
@@ -0,0 +1,5 @@
1
+ # TODO
2
+
3
+ ## Before gem release
4
+
5
+ * rake tasks for installing and removing themes
@@ -0,0 +1,25 @@
1
+ Gem::Specification.new do |s|
2
+ s.required_rubygems_version = Gem::Requirement.new(">= 0") if s.respond_to? :required_rubygems_version=
3
+
4
+ s.name = %q{compass-themes}
5
+ s.version = '0.0.1'
6
+ s.platform = Gem::Platform::RUBY
7
+
8
+ s.authors = ["Scott Davis"]
9
+ s.description = %q{Out of the box designs using the compass css framework}
10
+ s.summary = %q{Themes using compass}
11
+ s.email = %q{jetviper21@gmail.com}
12
+ s.date = Date.today.to_s
13
+ s.files = `git ls-files`.split("\n")
14
+ s.executables = `git ls-files`.split("\n").map{|f| f =~ /^bin\/(.*)/ ? $1 : nil}.compact
15
+ s.require_path = 'lib'
16
+ s.homepage = %q{http://github.com/jetviper21/}
17
+ s.rdoc_options = ["--charset=UTF-8"]
18
+ s.required_rubygems_version = ">= 1.3.6"
19
+ s.add_development_dependency "bundler", ">= 1.0.0"
20
+ s.add_development_dependency "rspec", "~> 2.0.0"
21
+ s.add_development_dependency "mocha"
22
+ s.add_dependency 'haml', '>= 3.1.alpha.214'
23
+ s.add_dependency 'compass', '~> 0.11.beta.1'
24
+ s.add_dependency 'sass', '~> 3.1.0.alpha.218'
25
+ end
@@ -0,0 +1,24 @@
1
+ Feature: Command Line
2
+ In order to install a compass theme
3
+ As a user on the command line
4
+ I want to run the generators
5
+
6
+ Scenario: Install a theme into rails 3
7
+ Given I am in a new rails 3 application
8
+ And I have compass installed
9
+ And I have installed compass-themes with bundler
10
+ Then I should see "compass_theme" in the generators
11
+ When I run the compass_theme generator with "basic/dark.theme"
12
+ Then I expect the "basic/dark.theme" theme to be installed
13
+
14
+ Scenario: Install a theme into rails 3 app that already has a theme
15
+ Given I am in an existing rails 3 application with "basic/dark.theme" installed
16
+ Then I expect the "basic/dark.theme" theme to be installed
17
+ When I run the compass_theme generator with "basic/railscast.theme"
18
+ Then I expect the "basic/railscast.theme" theme to be installed
19
+
20
+ Scenario: Rails 3 app should have rake tasks
21
+ Given I am in an existing rails 3 application with "basic/dark.theme" installed
22
+ Then I expect to see "compass:themes" in the tasks list
23
+
24
+
@@ -0,0 +1,96 @@
1
+ GEM_PATH = File.join(File.expand_path('../', __FILE__), '..', '..')
2
+ require 'rspec'
3
+ Before do
4
+ @cleanup_directories = []
5
+ @original_working_directory = Dir.pwd
6
+ @project_name = 'my_test_app'
7
+ @project_path = "../#{@project_name}"
8
+ end
9
+
10
+ After do
11
+ clean_up_test_dir
12
+ end
13
+
14
+ def clean_up_test_dir
15
+ Dir.chdir @original_working_directory
16
+ @cleanup_directories.each do |dir|
17
+ FileUtils.rm_rf dir
18
+ end
19
+ @cleanup_directories = []
20
+ end
21
+
22
+ def append_gem_file(string)
23
+ File.open('Gemfile', 'a') do |f|
24
+ f << "#{string}\n"
25
+ end
26
+ end
27
+
28
+ def bundle_install
29
+ `bundle install --gemfile=#{Dir.pwd}/Gemfile`
30
+ end
31
+
32
+ def install_rails(path)
33
+ @cleanup_directories << path
34
+ `rails new #{path}`
35
+ end
36
+
37
+ def install_compass_themes(install = true)
38
+ append_gem_file("gem 'compass-themes', :path => '#{GEM_PATH}'")
39
+ bundle_install if install
40
+ end
41
+
42
+ def install_theme(theme)
43
+ `rails g compass_theme #{theme.gsub('.theme', '')} --force`
44
+ end
45
+
46
+ def install_compass(install = true)
47
+ `compass init rails`.match(/gem\s\"compass\"\,\s\"\>\=(.+)\"/)
48
+ append_gem_file("gem 'compass', '>= #{$1}'")
49
+ bundle_install if install
50
+ end
51
+
52
+ Given /^I am in a new rails (\d+) application$/ do |arg1|
53
+ install_rails(@project_path)
54
+ Dir.chdir @project_path
55
+ Dir.pwd.should include @project_name
56
+ end
57
+
58
+ Given /^I have installed compass\-themes with bundler$/ do
59
+ Dir.pwd.should include @project_name # im paranoid
60
+ install_compass_themes.should include('compass-themes')
61
+ end
62
+
63
+ Given /^I have compass installed$/ do
64
+ unless File.exists?('app/stylesheets/screen.scss')
65
+ install_compass.should include('compass')
66
+ end
67
+ File.exists?('app/stylesheets/screen.scss').should == true
68
+ end
69
+
70
+
71
+ Then /^I should see "([^"]*)" in the generators$/ do |arg1|
72
+ `rails g --help`.should include(arg1)
73
+ end
74
+
75
+ When /^I run the compass_theme generator with "([^"]*)"$/ do |theme|
76
+ Dir.pwd.should include @project_name # im paranoid
77
+ install_theme(theme).should include('append')
78
+ end
79
+
80
+ Then /^I expect the "([^"]*)" theme to be installed$/ do |theme|
81
+ File.read('app/stylesheets/screen.scss').should include(theme)
82
+ end
83
+
84
+ Then /^I expect to see "([^"]*)" in the tasks list$/ do |task|
85
+ `rake -T`.should include(task)
86
+ end
87
+
88
+ Given /^I am in an existing rails (\d+) application with "([^"]*)" installed$/ do |arg1, theme|
89
+ clean_up_test_dir
90
+ install_rails(@project_path)
91
+ Dir.chdir @project_path
92
+ install_compass
93
+ install_compass_themes
94
+ install_theme(theme)
95
+ Dir.pwd.should include @project_name
96
+ end
data/init.rb ADDED
@@ -0,0 +1 @@
1
+ require 'compass-themes'
@@ -0,0 +1,11 @@
1
+ module CompassThemes
2
+ require 'rails'
3
+ class Railtie < ::Rails::Railtie
4
+ generators do
5
+ require File.join(File.expand_path('../', __FILE__), 'railties', 'generators', 'compass_theme', 'compass_theme_generator.rb')
6
+ end
7
+ rake_tasks do
8
+ load File.join(File.expand_path('../', __FILE__), 'railties', 'tasks', 'themes.rake')
9
+ end
10
+ end
11
+ end
@@ -0,0 +1,83 @@
1
+ require "#{File.dirname(__FILE__)}/../generator_helper"
2
+ class CompassThemeGenerator < Rails::Generators::Base
3
+ APP_LAYOUT = 'application.html.haml'
4
+ RAKE_NOTICE = "Please run rake compass:themes to view all available themes"
5
+ source_root File.join(File.expand_path(__FILE__), '..', '..', '..', '..', 'templates')
6
+ argument :theme_path, :type => :string, :banner => "basic/dark", :required => true
7
+ #method_options :force => false
8
+
9
+ desc "Installs a compass theme"
10
+
11
+ def verify_that_arg_is_a_theme_combo
12
+ themes = CompassThemes::GeneratorHelper.available_themes
13
+ unless themes[args[:layout].to_sym] && themes[args[:layout].to_sym].include?(args[:theme].gsub(/(.+)\.theme/){ $1 })
14
+ say "Theme combination not found!", Thor::Shell::Color::RED
15
+ say RAKE_NOTICE, Thor::Shell::Color::YELLOW
16
+ exit
17
+ end
18
+ end
19
+
20
+ def remove_layout
21
+ layout_path = Rails.root.join('app', 'views', 'layouts')
22
+ layouts = Dir["#{layout_path}/application.*.haml"]
23
+ layouts.each do |f|
24
+ if APP_LAYOUT == File.basename(f.to_s) && !options[:force]
25
+ say "Conflict found trying to install layout file", Thor::Shell::Color::YELLOW
26
+ if ask("Would you like to back up your old layout? [Y/n]").downcase == 'y'
27
+ backup = "#{APP_LAYOUT}.old"
28
+ FileUtils.cp(f.to_s, File.join(layout_path, backup))
29
+ say("Backing up old layout file to #{backup}", Thor::Shell::Color::GREEN)
30
+ end
31
+ end
32
+ remove_file f.to_s
33
+ end
34
+ end
35
+
36
+ def copy_layout
37
+ layout_file = layout_filename
38
+ copy_file layout_file, Rails.root.join('app', 'views', 'layouts', 'application.html.haml')
39
+ end
40
+
41
+ def remove_old_theme_include
42
+ gsub_file compass_file, /^@import\s\".+\";\s\/\/compass\-theme$/, ''
43
+ end
44
+
45
+ def add_import
46
+ gsub_file compass_file, /^@import\s\"compass\/reset\";$/, "//@import \"compass/reset\";"
47
+ append_file compass_file, "@import \"#{args[:layout]}/#{args[:theme]}\"; //compass-theme"
48
+ end
49
+
50
+ private
51
+
52
+ def layout_filename
53
+ "#{parse_arg[:layout]}.html.haml"
54
+ end
55
+
56
+ def parse_arg
57
+ if /([a-z\-\_]+)\\\/([a-z\-\_]+)/.match(theme_path)
58
+ say "Incorrect Theme format please use: layout/theme", Thor::Shell::Color::RED
59
+ say RAKE_NOTICE, Thor::Shell::Color::YELLOW
60
+ exit
61
+ end
62
+ _args = theme_path.split('/')
63
+ {:layout => _args.first, :theme => "#{_args.last}.theme"}
64
+ end
65
+
66
+ def args
67
+ @args ||= parse_arg
68
+ end
69
+
70
+ def compass_file
71
+ %w(scss sass).each do |ext|
72
+ file = Rails.root.join('app', 'stylesheets' , "screen.#{ext}")
73
+ return file if File.exists?(file)
74
+ end
75
+ say "screen.s(css|ass) does not exist have you installed compass?", Thor::Shell::Color::RED
76
+ exit
77
+ end
78
+
79
+ def template_path
80
+ File.join(File.expand_path('../templates', __FILE__), '..', '..', '..', 'templates')
81
+ end
82
+
83
+ end
@@ -0,0 +1,19 @@
1
+ module CompassThemes
2
+ class GeneratorHelper
3
+ class << self
4
+ LOCAL_ROOT = File.expand_path('../', __FILE__)
5
+ def available_themes
6
+ themes = {}
7
+ Dir["#{LOCAL_ROOT}/../../templates/**/*.html.haml"].each do |template|
8
+ short_name = File.basename(template).gsub(/(.+)\.html\.haml/) { $1 }
9
+ themes[short_name.to_sym] = []
10
+ Dir["#{LOCAL_ROOT}/../../stylesheets/#{short_name}/*.scss"].each do |stylesheet|
11
+ next unless stylesheet.include?('.theme')
12
+ themes[short_name.to_sym] << File.basename(stylesheet).gsub(/^\_(.+)\.theme\.scss/) { $1 }
13
+ end
14
+ end
15
+ themes
16
+ end
17
+ end
18
+ end
19
+ end
@@ -0,0 +1,27 @@
1
+ require "#{File.dirname(__FILE__)}/../generators/generator_helper"
2
+ namespace :compass do
3
+ desc "List all available compass themes"
4
+ task :themes do
5
+ puts "Compass Themes:"
6
+ puts " To install a compass theme please run"
7
+ puts " rails g compass_theme layout/theme"
8
+ puts "------------ Themes -------------"
9
+ CompassThemes::GeneratorHelper.available_themes.each do |layout, themes|
10
+ puts ' ' + layout.to_s + ':'
11
+ themes.each do |theme|
12
+ puts ' ' + theme
13
+ end
14
+ end
15
+ end
16
+ #todo
17
+ #namespace :theme do
18
+ # desc "install a compass theme"
19
+ # task :install do
20
+ # puts "this doesn't work yet"
21
+ # end
22
+ # desc "remove a compass theme"
23
+ # task :remove do
24
+ # puts "this doesn't work yet"
25
+ # end
26
+ #end
27
+ end
@@ -0,0 +1,115 @@
1
+ @import "mixins";
2
+ @import "compass/reset/utilities";
3
+ @import "compass/utilities";
4
+
5
+ body, ul {
6
+ @include reset-box-model;
7
+ }
8
+
9
+ $bg-body:#2A5AA1;
10
+ $bg-container:white;
11
+ $contanier-text:#000000;
12
+ $border-continer:1px solid black;
13
+ $link-color:blue;
14
+
15
+ $bg-header:#414243;
16
+
17
+ $bg-flash-notice: #cfc;
18
+ $border-flash-notice:solid 1px #6c6;
19
+
20
+ $flash-text:black;
21
+ $bg-flash-error:#fcc;
22
+ $border-flash-error:solid 1px #c66;
23
+
24
+ $menu-button-color:#ccc;
25
+ $menu-text-color:black;
26
+ $menu-button-border:none;
27
+
28
+ $menu-button-hover-color:#292E2A;
29
+ $menu-text-hover-color:white;
30
+
31
+ $table-row-color:#98A19A;
32
+ $table-alt-row-color:#eee;
33
+ $table-text-color:black;
34
+
35
+ @mixin theme_header {
36
+ min-width:882px;
37
+ background-color:$bg-header;
38
+ h1 {
39
+ @include float-left;
40
+ margin-top: 10px;
41
+ padding-left:100px;
42
+ color:lighten($contanier-text, 100%);
43
+ }
44
+ }
45
+
46
+ @mixin theme_menu {
47
+ height:60px;
48
+ ul:after {
49
+ content: ".";
50
+ display: block;
51
+ height: 0;
52
+ clear: both;
53
+ visibility: hidden;
54
+ }
55
+ ul {
56
+ @include float-right;
57
+ padding-right:150px;
58
+ padding-top:15px;
59
+ font:{
60
+ size:20px;
61
+ };
62
+ li {
63
+ display:inline-block;
64
+ a {
65
+ $desat:desaturate($table-text-color, 100%);
66
+ @include link-colors(lighten($link-color, 100%), $desat);
67
+ }
68
+ }
69
+ }
70
+ }
71
+
72
+ @mixin theme_content {
73
+ position:relative;
74
+ min-width:800px;
75
+ color:$contanier-text;
76
+ padding: 20px 40px;
77
+ background-color:$bg-container;
78
+ border:$border-continer;
79
+ }
80
+
81
+ @mixin theme_body {
82
+ background-color:$bg-body;
83
+ a {
84
+ @include link-colors($link-color, desaturate($link-color, 100%));
85
+ }
86
+ padding:{
87
+ left:50px;
88
+ right:50px;
89
+ bottom:50px;
90
+ }
91
+ }
92
+
93
+ body {
94
+ @include theme_body;
95
+ #header {
96
+ @include theme_header;
97
+ #menu {
98
+ @include theme_menu;
99
+ }
100
+ }
101
+ #content {
102
+ @include theme_content;
103
+ @include theme_flash;
104
+ @include theme_table;
105
+ #right_sidebar {
106
+ @include theme_sidebar('right', 160px);
107
+ padding:10px;
108
+ ul {
109
+ li {
110
+ list-style:none;
111
+ }
112
+ }
113
+ }
114
+ }
115
+ }
@@ -0,0 +1,38 @@
1
+ @import "mixins";
2
+
3
+ $bg-body:black;
4
+ $bg-container:#454946;
5
+ $contanier-text:#eee;
6
+ $border-continer:none;
7
+ $link-color:#ccc;
8
+
9
+ $bg-flash-notice: #cfc;
10
+ $border-flash-notice:solid 1px #6c6;
11
+
12
+ $flash-text:black;
13
+ $bg-flash-error:#fcc;
14
+ $border-flash-error:solid 1px #c66;
15
+
16
+ $menu-button-color:#ccc;
17
+ $menu-text-color:black;
18
+ $menu-button-border:none;
19
+
20
+ $menu-button-hover-color:#292E2A;
21
+ $menu-text-hover-color:white;
22
+
23
+ $table-row-color:#98A19A;
24
+ $table-alt-row-color:#eee;
25
+ $table-text-color:black;
26
+
27
+ body {
28
+ @include theme_body;
29
+ }
30
+ #header #menu {
31
+ @include theme_menu;
32
+ }
33
+
34
+ #content {
35
+ @include theme_content;
36
+ @include theme_flash;
37
+ @include theme_table;
38
+ }
@@ -0,0 +1,138 @@
1
+ @import "compass/utilities/links/link-colors";
2
+
3
+ @mixin theme_body {
4
+ background-color:$bg-body;
5
+ a {
6
+ @include link-colors($link-color, desaturate($link-color, 100%));
7
+ }
8
+ }
9
+
10
+ @mixin theme_content {
11
+ position:relative;
12
+ color:$contanier-text;
13
+ padding: 20px 40px;
14
+ background-color:$bg-container;
15
+ border:$border-continer;
16
+ }
17
+
18
+ /**
19
+ Out puts the styles needed for a flash box
20
+ **/
21
+ @mixin theme_flash($flash_id = 'flash') {
22
+ .#{$flash_id} {
23
+ padding:5px 8px;
24
+ margin: 10px 0;
25
+ color:#{$flash-text};
26
+ }
27
+
28
+ ##{$flash_id}_notice {
29
+ background-color:$bg-flash-notice;
30
+ border:$border-flash-notice;
31
+ }
32
+
33
+ ##{$flash_id}_error, ##{$flash_id}_alert {
34
+ background-color:$bg-flash-error;
35
+ border:$border-flash-error;
36
+ }
37
+
38
+ }
39
+
40
+ @mixin theme_menu {
41
+ ul {
42
+ list-style: none;
43
+ margin: 0;
44
+ padding:0;
45
+ li {
46
+ margin: 0;
47
+ padding:0;
48
+ display:inline-block;
49
+ a {
50
+ display:block;
51
+ padding: 4px 8px;
52
+ text-decoration:none;
53
+ border: $menu-button-border;
54
+ color: $menu-text-color;
55
+ background-color:$menu-button-color;
56
+ }
57
+ a:hover, a.active {
58
+ color: $menu-text-hover-color;
59
+ background-color:$menu-button-hover-color;
60
+ }
61
+ }
62
+ }
63
+ }
64
+ //$table-row-color
65
+ //$table-alt-row-color
66
+ @mixin theme_table($width = '600px') {
67
+ table {
68
+ color:$table-text-color;
69
+ width:$width;
70
+ border-spacing:0pt;
71
+ tr, th {
72
+ color:$table-text-color;
73
+ background-color:$table-row-color;
74
+ }
75
+ tr.alt {
76
+ color:$table-text-color;
77
+ background-color:$table-alt-row-color;
78
+ }
79
+ td {
80
+ a {
81
+ $desat:desaturate($table-text-color, 100%);
82
+ @include link-colors($table-text-color, $desat);
83
+ }
84
+ color:$table-text-color;
85
+ padding:5px;
86
+ }
87
+ }
88
+ }
89
+
90
+ @mixin error_explation($root = ".error_messages") {
91
+ .fieldWithErrors {
92
+ display:inline;
93
+ }
94
+ #{$root} {
95
+ width:400px;
96
+ border:2px solid #cf0000;
97
+ padding:0px;
98
+ padding-bottom: 20px;
99
+ background-color:#f0f0f0;
100
+ h2 {
101
+ text-align:left;
102
+ font-weight:bold;
103
+ padding:5px 5px 5px 15px;
104
+ font-size: 12px;
105
+ margin: 0px;
106
+ background-color: #c00;
107
+ color: #fff;
108
+ }
109
+ p {
110
+ padding: 8px 10px;
111
+ }
112
+ ul {
113
+ margin:0;
114
+ }
115
+ }
116
+ }
117
+
118
+ @mixin theme_sidebar($side:'left', $width:200px) {
119
+ margin:10px;
120
+ width:$width;
121
+ border:1px solid black;
122
+ @if $side == 'left' {
123
+ @include float-left;
124
+ margin-left:0;
125
+ } @else {
126
+ @include float-right;
127
+ margin-right:0;
128
+ }
129
+ zoom:1;
130
+ &:after {
131
+ content: ".";
132
+ display: block;
133
+ height: 0;
134
+ clear: both;
135
+ visibility: hidden;
136
+ zoom:1;
137
+ }
138
+ }
@@ -0,0 +1,76 @@
1
+ // This is your framework's main stylesheet. Use it to import all default modules.
2
+ @import "mixins";
3
+
4
+ $bg-body:#4b7399;
5
+ $bg-container:#ffffff;
6
+ $contanier-text:black;
7
+ $border-continer:solid 1px black;
8
+ $link-color:#0000ff;
9
+
10
+ $flash-text:black;
11
+
12
+ $bg-flash-notice: #cfc;
13
+ $border-flash-notice:solid 1px #6c6;
14
+
15
+ $bg-flash-error:#fcc;
16
+ $border-flash-error:solid 1px #c66;
17
+
18
+ $menu-button-color:#AEBBE2;
19
+ $menu-text-color:black;
20
+ $menu-button-border:solid black 1px;
21
+
22
+ $menu-button-hover-color:#4A63B8;
23
+ $menu-text-hover-color:white;
24
+
25
+ $table-row-color:$bg-container;
26
+ $table-alt-row-color:#ccc;
27
+ $table-text-color:black;
28
+
29
+ @mixin theme_menu {
30
+ ul:after {
31
+ content: ".";
32
+ display: block;
33
+ height: 0;
34
+ clear: both;
35
+ visibility: hidden;
36
+ }
37
+ ul {
38
+ list-style: none;
39
+ margin: 0;
40
+ padding:0;
41
+ zoom:1;
42
+ display:block;
43
+ li {
44
+ margin: 0;
45
+ padding:0;
46
+ float:left;
47
+ a {
48
+ display:block;
49
+ padding: 4px 8px;
50
+ text-decoration:none;
51
+ border: $menu-button-border;
52
+ color: $menu-text-color;
53
+ background-color:$menu-button-color;
54
+ }
55
+ a:hover {
56
+ color: $menu-text-hover-color;
57
+ background-color:$menu-button-hover-color;
58
+ }
59
+ }
60
+ }
61
+ }
62
+
63
+ body {
64
+ @include theme_body;
65
+ }
66
+ #header #menu {
67
+ @include theme_menu;
68
+ }
69
+
70
+ #content {
71
+ @include theme_content;
72
+ @include theme_flash;
73
+ @include theme_table;
74
+ }
75
+
76
+
@@ -0,0 +1,20 @@
1
+ !!!
2
+ %html
3
+ %head
4
+ = stylesheet_link_tag 'screen'
5
+ //insert javacript here
6
+ %title= yield :title
7
+ %body
8
+ #header
9
+ #menu
10
+ %ul
11
+ //add your own menu links here
12
+ - %w(one two three).each do |tmp|
13
+ %li
14
+ = link_to(tmp)
15
+ #content
16
+ - flash.each do |type, message|
17
+ %div{:id=>"flash_#{type}", :class => 'flash'}
18
+ = message
19
+ %h1= yield :title
20
+ = yield
@@ -0,0 +1,10 @@
1
+ description "Drop in themes for compass easy designs out of the box!"
2
+
3
+ help %Q{
4
+ Rails 3 is currently only supported
5
+
6
+ }
7
+
8
+ welcome_message %Q{
9
+ Please see the compass-themes website for documentation
10
+ }
@@ -0,0 +1,6 @@
1
+ if defined?(Rails)
2
+ require File.join(File.expand_path('../', __FILE__), 'compass-themes', 'railtie')
3
+ end
4
+ require 'compass'
5
+ Compass::Frameworks.register('compass-themes', :stylesheets_directory => File.join(File.expand_path('../', __FILE__), 'compass-themes','stylesheets'),
6
+ :templates_directory => File.join(File.expand_path('../', __FILE__), 'compass-themes', 'templates'))
@@ -0,0 +1,18 @@
1
+ require File.expand_path(File.dirname(__FILE__) + '/spec_helper')
2
+
3
+
4
+ describe 'Compass:Framework' do
5
+ before :all do
6
+ @ours = Compass::Frameworks::ALL.last #should always be the last registered
7
+ end
8
+
9
+ it "should have registered the stylesheet directories" do
10
+ @ours.name.should == 'compass-themes'
11
+ @ours.stylesheets_directory.should == '/Users/sdavis/Work/compass-themes/lib/compass-themes/stylesheets'
12
+ end
13
+
14
+ it "should have registered the template directories" do
15
+ @ours.name.should == 'compass-themes'
16
+ @ours.templates_directory.should == '/Users/sdavis/Work/compass-themes/lib/compass-themes/templates'
17
+ end
18
+ end
@@ -0,0 +1,19 @@
1
+ require File.expand_path(File.dirname(__FILE__) + '/spec_helper')
2
+ require 'lib/compass-themes/railties/generators/generator_helper'
3
+
4
+ describe CompassThemes::GeneratorHelper do
5
+ it 'should return all themes as a hash' do
6
+ themes = CompassThemes::GeneratorHelper.available_themes
7
+ themes.should be_an(Hash)
8
+ themes.size.should_not == 0
9
+ stylesheets = Dir["lib/compass-themes/stylesheets/**/*.scss"]
10
+ stylesheets.map! do |sheet|
11
+ next unless sheet.include?('.theme')
12
+ File.basename(sheet).gsub(/\_(.+)\.theme\.scss/) { $1 }
13
+ end.compact!
14
+ themes.each do |key, value|
15
+ value.should be_an(Array)
16
+ value.sort.should == stylesheets.sort
17
+ end
18
+ end
19
+ end
@@ -0,0 +1,6 @@
1
+ require File.join(File.expand_path('../', __FILE__), '..', 'lib', 'compass-themes.rb')
2
+ require 'rspec'
3
+
4
+ Rspec.configure do |c|
5
+ c.mock_with :mocha
6
+ end
metadata ADDED
@@ -0,0 +1,190 @@
1
+ --- !ruby/object:Gem::Specification
2
+ name: compass-themes
3
+ version: !ruby/object:Gem::Version
4
+ hash: 29
5
+ prerelease:
6
+ segments:
7
+ - 0
8
+ - 0
9
+ - 1
10
+ version: 0.0.1
11
+ platform: ruby
12
+ authors:
13
+ - Scott Davis
14
+ autorequire:
15
+ bindir: bin
16
+ cert_chain: []
17
+
18
+ date: 2011-01-23 00:00:00 -05:00
19
+ default_executable:
20
+ dependencies:
21
+ - !ruby/object:Gem::Dependency
22
+ name: bundler
23
+ prerelease: false
24
+ requirement: &id001 !ruby/object:Gem::Requirement
25
+ none: false
26
+ requirements:
27
+ - - ">="
28
+ - !ruby/object:Gem::Version
29
+ hash: 23
30
+ segments:
31
+ - 1
32
+ - 0
33
+ - 0
34
+ version: 1.0.0
35
+ type: :development
36
+ version_requirements: *id001
37
+ - !ruby/object:Gem::Dependency
38
+ name: rspec
39
+ prerelease: false
40
+ requirement: &id002 !ruby/object:Gem::Requirement
41
+ none: false
42
+ requirements:
43
+ - - ~>
44
+ - !ruby/object:Gem::Version
45
+ hash: 15
46
+ segments:
47
+ - 2
48
+ - 0
49
+ - 0
50
+ version: 2.0.0
51
+ type: :development
52
+ version_requirements: *id002
53
+ - !ruby/object:Gem::Dependency
54
+ name: mocha
55
+ prerelease: false
56
+ requirement: &id003 !ruby/object:Gem::Requirement
57
+ none: false
58
+ requirements:
59
+ - - ">="
60
+ - !ruby/object:Gem::Version
61
+ hash: 3
62
+ segments:
63
+ - 0
64
+ version: "0"
65
+ type: :development
66
+ version_requirements: *id003
67
+ - !ruby/object:Gem::Dependency
68
+ name: haml
69
+ prerelease: false
70
+ requirement: &id004 !ruby/object:Gem::Requirement
71
+ none: false
72
+ requirements:
73
+ - - ">="
74
+ - !ruby/object:Gem::Version
75
+ hash: -3702664648
76
+ segments:
77
+ - 3
78
+ - 1
79
+ - alpha
80
+ - 214
81
+ version: 3.1.alpha.214
82
+ type: :runtime
83
+ version_requirements: *id004
84
+ - !ruby/object:Gem::Dependency
85
+ name: compass
86
+ prerelease: false
87
+ requirement: &id005 !ruby/object:Gem::Requirement
88
+ none: false
89
+ requirements:
90
+ - - ~>
91
+ - !ruby/object:Gem::Version
92
+ hash: 62196233
93
+ segments:
94
+ - 0
95
+ - 11
96
+ - beta
97
+ - 1
98
+ version: 0.11.beta.1
99
+ type: :runtime
100
+ version_requirements: *id005
101
+ - !ruby/object:Gem::Dependency
102
+ name: sass
103
+ prerelease: false
104
+ requirement: &id006 !ruby/object:Gem::Requirement
105
+ none: false
106
+ requirements:
107
+ - - ~>
108
+ - !ruby/object:Gem::Version
109
+ hash: -3702664552
110
+ segments:
111
+ - 3
112
+ - 1
113
+ - 0
114
+ - alpha
115
+ - 218
116
+ version: 3.1.0.alpha.218
117
+ type: :runtime
118
+ version_requirements: *id006
119
+ description: Out of the box designs using the compass css framework
120
+ email: jetviper21@gmail.com
121
+ executables: []
122
+
123
+ extensions: []
124
+
125
+ extra_rdoc_files: []
126
+
127
+ files:
128
+ - .document
129
+ - .gitignore
130
+ - Gemfile
131
+ - LICENSE.txt
132
+ - README.mdown
133
+ - Rakefile
134
+ - TODO.mdown
135
+ - compass_themes.gemspec
136
+ - features/rails3.feature
137
+ - features/step_definitions/command_line_steps.rb
138
+ - init.rb
139
+ - lib/compass-themes.rb
140
+ - lib/compass-themes/railtie.rb
141
+ - lib/compass-themes/railties/generators/compass_theme/compass_theme_generator.rb
142
+ - lib/compass-themes/railties/generators/generator_helper.rb
143
+ - lib/compass-themes/railties/tasks/themes.rake
144
+ - lib/compass-themes/stylesheets/basic/_blue-fluid.theme.scss
145
+ - lib/compass-themes/stylesheets/basic/_dark.theme.scss
146
+ - lib/compass-themes/stylesheets/basic/_mixins.scss
147
+ - lib/compass-themes/stylesheets/basic/_railscast.theme.scss
148
+ - lib/compass-themes/templates/basic.html.haml
149
+ - lib/compass-themes/templates/project/manifest.rb
150
+ - spec/compass_spec.rb
151
+ - spec/generator_helper_spec.rb
152
+ - spec/spec_helper.rb
153
+ has_rdoc: true
154
+ homepage: http://github.com/jetviper21/
155
+ licenses: []
156
+
157
+ post_install_message:
158
+ rdoc_options:
159
+ - --charset=UTF-8
160
+ require_paths:
161
+ - lib
162
+ required_ruby_version: !ruby/object:Gem::Requirement
163
+ none: false
164
+ requirements:
165
+ - - ">="
166
+ - !ruby/object:Gem::Version
167
+ hash: 3
168
+ segments:
169
+ - 0
170
+ version: "0"
171
+ required_rubygems_version: !ruby/object:Gem::Requirement
172
+ none: false
173
+ requirements:
174
+ - - ">="
175
+ - !ruby/object:Gem::Version
176
+ hash: 23
177
+ segments:
178
+ - 1
179
+ - 3
180
+ - 6
181
+ version: 1.3.6
182
+ requirements: []
183
+
184
+ rubyforge_project:
185
+ rubygems_version: 1.4.2
186
+ signing_key:
187
+ specification_version: 3
188
+ summary: Themes using compass
189
+ test_files: []
190
+