chriseppstein-compass 0.5.5 → 0.5.9

Sign up to get free protection for your applications and to get access to all the features.
Files changed (49) hide show
  1. data/Manifest +17 -3
  2. data/VERSION +1 -1
  3. data/compass.gemspec +4 -4
  4. data/examples/blueprint_plugins/images/buttons/cross.png +0 -0
  5. data/examples/blueprint_plugins/images/buttons/key.png +0 -0
  6. data/examples/blueprint_plugins/images/buttons/tick.png +0 -0
  7. data/examples/blueprint_plugins/index.html +7 -0
  8. data/examples/blueprint_plugins/parts/buttons.html +59 -0
  9. data/examples/blueprint_plugins/src/buttons.sass +49 -0
  10. data/examples/compass/src/utilities.sass +34 -2
  11. data/examples/compass/utilities.html.haml +45 -1
  12. data/frameworks/blueprint/stylesheets/blueprint/_ie.sass +3 -1
  13. data/frameworks/blueprint/stylesheets/blueprint/_print.sass +2 -1
  14. data/frameworks/blueprint/stylesheets/blueprint/modules/_buttons.sass +84 -0
  15. data/frameworks/blueprint/stylesheets/blueprint/modules/_grid.sass +6 -4
  16. data/frameworks/blueprint/stylesheets/blueprint/modules/_liquid.sass +3 -3
  17. data/frameworks/blueprint/stylesheets/blueprint/modules/_typography.sass +3 -2
  18. data/frameworks/blueprint/stylesheets/blueprint/modules/_utilities.sass +1 -1
  19. data/frameworks/blueprint/templates/buttons/buttons.sass +49 -0
  20. data/frameworks/blueprint/templates/buttons/buttons/cross.png +0 -0
  21. data/frameworks/blueprint/templates/buttons/buttons/key.png +0 -0
  22. data/frameworks/blueprint/templates/buttons/buttons/tick.png +0 -0
  23. data/frameworks/blueprint/templates/buttons/manifest.rb +5 -0
  24. data/frameworks/compass/stylesheets/compass/utilities/_general.sass +2 -0
  25. data/frameworks/compass/stylesheets/compass/utilities/general/_clearfix.sass +23 -10
  26. data/frameworks/compass/stylesheets/compass/utilities/general/_float.sass +17 -0
  27. data/frameworks/compass/stylesheets/compass/utilities/general/_hacks.sass +6 -0
  28. data/frameworks/compass/stylesheets/compass/utilities/lists/_horizontal_list.sass +2 -2
  29. data/frameworks/yui/stylesheets/yui/modules/_grids.sass +1 -1
  30. data/lib/compass/actions.rb +2 -3
  31. data/lib/compass/commands/create_project.rb +5 -26
  32. data/lib/compass/commands/generate_grid_background.rb +27 -0
  33. data/lib/compass/commands/project_base.rb +4 -0
  34. data/lib/compass/commands/stamp_pattern.rb +45 -0
  35. data/lib/compass/commands/validate_project.rb +21 -0
  36. data/lib/compass/configuration.rb +4 -0
  37. data/lib/compass/exec.rb +23 -0
  38. data/{frameworks/blueprint/lib/blueprint → lib/compass}/grid_builder.rb +26 -8
  39. data/lib/compass/installers/base.rb +20 -2
  40. data/lib/compass/installers/manifest.rb +1 -0
  41. data/lib/compass/installers/rails.rb +2 -3
  42. data/lib/compass/installers/stand_alone.rb +2 -6
  43. data/lib/compass/validator.rb +19 -22
  44. data/test/fixtures/stylesheets/blueprint/css/typography.css +2 -0
  45. data/test/fixtures/stylesheets/compass/css/utilities.css +13 -2
  46. data/test/fixtures/stylesheets/compass/sass/utilities.sass +3 -2
  47. metadata +23 -6
  48. data/frameworks/blueprint/lib/blueprint/constants.rb +0 -17
  49. data/lib/compass/validate.rb +0 -13
@@ -15,7 +15,7 @@
15
15
  // * subtraction.com/archives/2007/0318_oh_yeeaahh.php
16
16
  // --------------------------------------------------------------
17
17
 
18
- @import compass/utilities/general/clearfix.sass
18
+ @import compass/utilities/general/float.sass
19
19
 
20
20
  // Main layout grid, override these constants to build your grid and container sizes.
21
21
  !blueprint_grid_columns ||= 24
@@ -77,12 +77,14 @@
77
77
 
78
78
  // Use this mixins to set the width of n columns.
79
79
  =column(!n, !last = false)
80
- :float left
80
+ +float-left
81
81
  +span(!n)
82
82
  @if !last
83
83
  +last
84
84
  @else
85
85
  :margin-right = !blueprint_grid_margin
86
+ * html &
87
+ :overflow-x hidden
86
88
 
87
89
  // Mixin to a column to append n empty cols.
88
90
  =append(!n)
@@ -94,7 +96,7 @@
94
96
 
95
97
  // mixin to a column to move it n columns to the left
96
98
  =pull(!n, !last = false)
97
- :float left
99
+ +float-left
98
100
  :position relative
99
101
  @if !last
100
102
  :margin-left = (-!blueprint_grid_outer_width * !n) + !blueprint_grid_margin
@@ -103,7 +105,7 @@
103
105
 
104
106
  // mixin to a column to push it n columns to the right
105
107
  =push(!n)
106
- :float right
108
+ +float-right
107
109
  :position relative
108
110
  :margin
109
111
  :top 0
@@ -31,7 +31,7 @@
31
31
  // @import blueprint/modules/liquid.sass
32
32
  // -------------------------------------------------------------------
33
33
 
34
- @import compass/utilities/general/clearfix.sass
34
+ @import compass/utilities/general/float.sass
35
35
 
36
36
  // Main layout grid, override these constants to build your grid and container sizes.
37
37
  // The width shown gives the right floored percentage values.
@@ -88,7 +88,7 @@
88
88
  :margin-right 0
89
89
 
90
90
  =column(!n, !last = false)
91
- :float left
91
+ +float-left
92
92
  :overflow hidden
93
93
  +span(!n)
94
94
  @if !last
@@ -106,7 +106,7 @@
106
106
  :margin-left= (!blueprint_liquid_grid_push_pull * !n)
107
107
 
108
108
  =push(!n)
109
- :float right
109
+ +float-right
110
110
  :margin
111
111
  :top 0
112
112
  :left 1.5em
@@ -1,5 +1,6 @@
1
1
  @import colors.sass
2
2
  @import compass/utilities/links/link_colors.sass
3
+ @import compass/utilities/general/float.sass
3
4
 
4
5
  !blueprint_font_family ||= "Helvetica Neue, Helvetica, Arial, sans-serif"
5
6
  !blueprint_fixed_font_family ||= "'andale mono', 'lucida console', monospace"
@@ -84,11 +85,11 @@
84
85
  p
85
86
  :margin 0 0 1.5em
86
87
  img
87
- :float left
88
+ +float-left
88
89
  :margin 1.5em 1.5em 1.5em 0
89
90
  :padding 0
90
91
  &.right
91
- :float right
92
+ +float-right
92
93
  :margin 1.5em 0 1.5em 1.5em
93
94
  a
94
95
  :text-decoration underline
@@ -1,5 +1,5 @@
1
1
  @import compass/utilities/text/nowrap.sass
2
- @import compass/utilities/general/clearfix.sass
2
+ @import compass/utilities/general/float.sass
3
3
 
4
4
  // Most of these utility classes are not "semantic". If you use them,
5
5
  // you are mixing your content and presentation. For shame!
@@ -0,0 +1,49 @@
1
+ @import compass/utilities/general/float.sass
2
+ @import blueprint/modules/buttons.sass
3
+
4
+ //
5
+ Use the following HTML code to place the buttons on your site:
6
+
7
+ <button type="submit" class="button positive">
8
+ <img src="css/blueprint/plugins/buttons/icons/tick.png" alt=""/> Save
9
+ </button>
10
+
11
+ <a class="button" href="/password/reset/">
12
+ <img src="css/blueprint/plugins/buttons/icons/key.png" alt=""/> Change Password
13
+ </a>
14
+
15
+ <a href="#" class="button negative">
16
+ <img src="css/blueprint/plugins/buttons/icons/cross.png" alt=""/> Cancel
17
+ </a>
18
+
19
+ a.button
20
+ // you can pass "left" or "right" to +anchor-button to float it in that direction
21
+ // or you can pass no argument to leave it inline-block (cross browser safe!) within
22
+ // the flow of your page.
23
+ +anchor-button("left")
24
+ // All the button color mixins take 4 optional arguments:
25
+ // font color, background color, border color, border highlight color
26
+ // the first three default to constants set in blueprint/modules/buttons.sass
27
+ // the last one defaults to a shade lighter than the border color.
28
+ +button-colors
29
+ +button-hover-colors
30
+ +button-active-colors
31
+
32
+ button
33
+ // The +button-button mixin is just like the +anchor-button mixin, but for <button> elements.
34
+ +button-button("left")
35
+ +button-colors
36
+ +button-hover-colors
37
+ +button-active-colors
38
+
39
+ // We can change the colors for buttons of certain classes, etc.
40
+ a.positive, button.positive
41
+ :color #529214
42
+ +button-hover-colors(#529214, #E6EFC2, #C6D880)
43
+ +button-active-colors(#FFF, #529214, #529214)
44
+
45
+ a.negative, button.negative
46
+ :color #D12F19
47
+ +button-hover-colors(#D12F19, #FBE3E4, #FBC2C4)
48
+ +button-active-colors(#FFF, #D12F19, #D12F19)
49
+
@@ -0,0 +1,5 @@
1
+ stylesheet 'buttons.sass', :media => 'screen, projection'
2
+
3
+ image 'buttons/cross.png'
4
+ image 'buttons/key.png'
5
+ image 'buttons/tick.png'
@@ -1,4 +1,6 @@
1
1
  @import general/reset.sass
2
2
  @import general/clearfix.sass
3
+ @import general/float.sass
3
4
  @import general/tag_cloud.sass
4
5
  @import general/inline_block.sass
6
+ @import general/hacks.sass
@@ -1,11 +1,24 @@
1
- // Clearing floats without extra markup
2
- // Simple Clearing of Floats
3
- // [http://www.sitepoint.com/blogs/2005/02/26/simple-clearing-of-floats/]
1
+ @import hacks.sass
2
+
3
+ //**
4
+ Extends the element to enclose any floats it contains.
5
+ This basic method is preferred for the usual case, when positioned content will not show outside the bounds of the container.
6
+ Recommendations include using this in conjunction with a width:
7
+ http://www.quirksmode.org/blog/archives/2005/03/clearing_floats.html
4
8
  =clearfix
5
- :overflow auto
6
- :overflow -moz-scrollbars-none
7
- // This makes ie6 get layout
8
- :display inline-block
9
- // and this puts it back to block
10
- &
11
- :display block
9
+ :overflow hidden
10
+ +has-layout
11
+
12
+ //**
13
+ Extends the element to enclose any floats it contains.
14
+ This older "Easy Clearing" method has the advantage of allowing positioned elements to hang outside the bounds of the container, at the expense of more tricky CSS.
15
+ http://www.positioniseverything.net/easyclearing.html
16
+ =pie-clearfix
17
+ &:after
18
+ :content " "
19
+ :display block
20
+ :height 0
21
+ :clear both
22
+ :overflow hidden
23
+ :visibility hidden
24
+ +has-layout
@@ -0,0 +1,17 @@
1
+ //**\\
2
+ Float
3
+
4
+ @import clearfix.sass
5
+
6
+ // Implementation of float:left with fix for double-margin bug
7
+ =float-left
8
+ +float("left")
9
+
10
+ // Implementation of float:right with fix for double-margin bug
11
+ =float-right
12
+ +float("right")
13
+
14
+ // Available as alternate syntax with just +float
15
+ =float(!side = "left")
16
+ :display inline
17
+ :float= !side
@@ -0,0 +1,6 @@
1
+ =has-layout
2
+ // This makes ie6 get layout
3
+ :display inline-block
4
+ // and this puts it back to block
5
+ &
6
+ :display block
@@ -1,6 +1,6 @@
1
1
  @import bullets.sass
2
2
  @import compass/utilities/general/reset.sass
3
- @import compass/utilities/general/clearfix.sass
3
+ @import compass/utilities/general/float.sass
4
4
 
5
5
  // A list(ol,ul) that is layed out such that the elements are floated left and won't wrap.
6
6
  // This is not an inline list.
@@ -10,7 +10,7 @@
10
10
  li
11
11
  +no-bullet
12
12
  :white-space nowrap
13
- :float left
13
+ +float-left
14
14
  :padding
15
15
  :left= !padding
16
16
  :right= !padding
@@ -1,7 +1,7 @@
1
1
  // This is a port of YUI Grids version 2.6.0
2
2
  // Note: This is not really tested yet. Use at your own risk.
3
3
 
4
- @import compass/utilities/general/clearfix.sass
4
+ @import compass/utilities/general/float.sass
5
5
  @import fonts.sass
6
6
 
7
7
  =yui-grids
@@ -25,7 +25,7 @@ module Compass
25
25
  else
26
26
  logger.record :directory, separate("#{basename(dir)}/")
27
27
  FileUtils.mkdir_p(dir) unless options[:dry_run]
28
- end
28
+ end
29
29
  end
30
30
 
31
31
  # Write a file given the file contents as a string
@@ -53,7 +53,6 @@ module Compass
53
53
 
54
54
  # Compile one Sass file
55
55
  def compile(sass_filename, css_filename, options)
56
- puts options.inspect
57
56
  logger.record :compile, basename(sass_filename)
58
57
  engine = ::Sass::Engine.new(open(sass_filename).read,
59
58
  :filename => sass_filename,
@@ -68,7 +67,7 @@ module Compass
68
67
  def basename(file)
69
68
  relativize(file) {|f| File.basename(file)}
70
69
  end
71
-
70
+
72
71
  def relativize(path)
73
72
  if path.index(working_path+File::SEPARATOR) == 0
74
73
  path[(working_path+File::SEPARATOR).length..-1]
@@ -1,39 +1,18 @@
1
1
  require 'fileutils'
2
- require File.join(File.dirname(__FILE__), 'base')
2
+ require File.join(File.dirname(__FILE__), 'stamp_pattern')
3
3
  require File.join(File.dirname(__FILE__), 'update_project')
4
4
  require File.join(Compass.lib_directory, 'compass', 'installers')
5
5
 
6
6
  module Compass
7
7
  module Commands
8
- class CreateProject < ProjectBase
9
-
10
- include Compass::Installers
11
-
12
- attr_accessor :installer
8
+ class CreateProject < StampPattern
13
9
 
14
10
  def initialize(working_path, options)
15
- super(working_path, options)
16
- installer_args = [project_template_directory, project_directory, self.options]
17
- @installer = case options[:project_type]
18
- when :stand_alone
19
- StandAloneInstaller.new *installer_args
20
- when :rails
21
- RailsInstaller.new *installer_args
22
- else
23
- raise "Unknown project type: #{project_type}"
24
- end
25
- end
26
-
27
- # all commands must implement perform
28
- def perform
29
- installer.init
30
- installer.run(:skip_finalization => true)
31
- UpdateProject.new(working_path, options).perform if installer.compilation_required?
32
- installer.finalize(:create => true)
11
+ super(working_path, options.merge(:pattern => "project", :pattern_name => nil))
33
12
  end
34
13
 
35
- def project_template_directory
36
- File.join(framework.templates_directory, "project")
14
+ def is_project_creation?
15
+ true
37
16
  end
38
17
 
39
18
  end
@@ -0,0 +1,27 @@
1
+ require File.join(File.dirname(__FILE__), 'project_base')
2
+ require File.join(File.dirname(__FILE__), 'update_project')
3
+ require File.join(File.dirname(__FILE__), '..', 'grid_builder')
4
+
5
+ module Compass
6
+ module Commands
7
+ class GenerateGridBackground < ProjectBase
8
+ include Actions
9
+ def initialize(working_path, options)
10
+ super
11
+ assert_project_directory_exists!
12
+ end
13
+
14
+ def perform
15
+ read_project_configuration
16
+ Compass.configuration.set_maybe(options)
17
+ Compass.configuration.set_defaults!
18
+ column_width, gutter_width = options[:grid_dimensions].split(/\+/).map{|d| d.to_i}
19
+ unless GridBuilder.new(options.merge(:column_width => column_width, :gutter_width => gutter_width, :output_path => projectize(project_images_subdirectory), :working_path => self.working_path)).generate!
20
+ puts "ERROR: Some library dependencies appear to be missing."
21
+ puts "Have you installed rmagick? If not, please run:"
22
+ puts "sudo gem install rmagick"
23
+ end
24
+ end
25
+ end
26
+ end
27
+ end
@@ -33,6 +33,10 @@ module Compass
33
33
  Compass.configuration.sass_dir
34
34
  end
35
35
 
36
+ def project_images_subdirectory
37
+ Compass.configuration.images_dir
38
+ end
39
+
36
40
  # Read the configuration file for this project
37
41
  def read_project_configuration
38
42
  if File.exists?(projectize('config.rb'))
@@ -0,0 +1,45 @@
1
+ require 'fileutils'
2
+ require File.join(File.dirname(__FILE__), 'base')
3
+ require File.join(File.dirname(__FILE__), 'update_project')
4
+ require File.join(Compass.lib_directory, 'compass', 'installers')
5
+
6
+ module Compass
7
+ module Commands
8
+ class StampPattern < ProjectBase
9
+
10
+ include Compass::Installers
11
+
12
+ attr_accessor :installer
13
+
14
+ def initialize(working_path, options)
15
+ super(working_path, options)
16
+ installer_args = [template_directory(options[:pattern]), project_directory, self.options]
17
+ @installer = case options[:project_type]
18
+ when :stand_alone
19
+ StandAloneInstaller.new *installer_args
20
+ when :rails
21
+ RailsInstaller.new *installer_args
22
+ else
23
+ raise "Unknown project type: #{project_type}"
24
+ end
25
+ end
26
+
27
+ # all commands must implement perform
28
+ def perform
29
+ installer.init
30
+ installer.run(:skip_finalization => true)
31
+ UpdateProject.new(working_path, options).perform if installer.compilation_required?
32
+ installer.finalize(:create => is_project_creation?)
33
+ end
34
+
35
+ def is_project_creation?
36
+ false
37
+ end
38
+
39
+ def template_directory(pattern)
40
+ File.join(framework.templates_directory, pattern)
41
+ end
42
+
43
+ end
44
+ end
45
+ end
@@ -0,0 +1,21 @@
1
+ require File.join(File.dirname(__FILE__), 'project_base')
2
+ require File.join(File.dirname(__FILE__), 'update_project')
3
+ require File.join(File.dirname(__FILE__), '..', 'validator')
4
+
5
+ module Compass
6
+ module Commands
7
+ class ValidateProject < ProjectBase
8
+
9
+ def initialize(working_path, options)
10
+ super
11
+ assert_project_directory_exists!
12
+ end
13
+
14
+ def perform
15
+ UpdateProject.new(working_path, options).perform
16
+ Validator.new(project_css_subdirectory).validate()
17
+ end
18
+
19
+ end
20
+ end
21
+ end
@@ -73,6 +73,10 @@ module Compass
73
73
  "stylesheets"
74
74
  end
75
75
 
76
+ def default_images_dir
77
+ "images"
78
+ end
79
+
76
80
  def default_output_style
77
81
  if environment == :development
78
82
  :expanded