compass 0.10.0.rc3 → 0.10.0.rc4

Sign up to get free protection for your applications and to get access to all the features.
Files changed (85) hide show
  1. data/Rakefile +30 -102
  2. data/VERSION.yml +1 -1
  3. data/examples/css3/bootstrap.rb +3 -0
  4. data/examples/css3/clean.rb +2 -0
  5. data/examples/downloader.rb +2 -2
  6. data/frameworks/_compass_deprecated_imports/stylesheets/compass/_misc.sass +1 -2
  7. data/frameworks/{compass → _compass_deprecated_imports}/stylesheets/compass/_misc.scss +1 -0
  8. data/frameworks/_compass_deprecated_imports/stylesheets/compass/css3/_inline_block.sass +1 -1
  9. data/frameworks/blueprint/stylesheets/_blueprint.scss +2 -1
  10. data/frameworks/blueprint/stylesheets/blueprint/_buttons.scss +47 -32
  11. data/frameworks/blueprint/stylesheets/blueprint/_colors.scss +25 -45
  12. data/frameworks/blueprint/stylesheets/blueprint/_debug.scss +6 -3
  13. data/frameworks/blueprint/stylesheets/blueprint/_fancy-type.scss +31 -24
  14. data/frameworks/blueprint/stylesheets/blueprint/_form.scss +45 -35
  15. data/frameworks/blueprint/stylesheets/blueprint/_grid.scss +2 -1
  16. data/frameworks/blueprint/stylesheets/blueprint/_link-icons.scss +21 -28
  17. data/frameworks/blueprint/stylesheets/blueprint/_typography.scss +66 -137
  18. data/frameworks/compass/stylesheets/compass/_css3.scss +1 -0
  19. data/frameworks/compass/stylesheets/compass/css3/_background-clip.scss +23 -5
  20. data/frameworks/compass/stylesheets/compass/css3/_background-origin.scss +22 -5
  21. data/frameworks/compass/stylesheets/compass/css3/_background-size.scss +8 -10
  22. data/frameworks/compass/stylesheets/compass/css3/_border-radius.scss +36 -16
  23. data/frameworks/compass/stylesheets/compass/css3/_box-shadow.scss +14 -7
  24. data/frameworks/compass/stylesheets/compass/css3/_box-sizing.scss +4 -8
  25. data/frameworks/compass/stylesheets/compass/css3/_box.scss +89 -0
  26. data/frameworks/compass/stylesheets/compass/css3/_columns.scss +19 -40
  27. data/frameworks/compass/stylesheets/compass/css3/_font-face.scss +3 -1
  28. data/frameworks/compass/stylesheets/compass/css3/_gradient.scss +2 -0
  29. data/frameworks/compass/stylesheets/compass/css3/_inline-block.scss +5 -6
  30. data/frameworks/compass/stylesheets/compass/css3/_opacity.scss +15 -9
  31. data/frameworks/compass/stylesheets/compass/css3/_shared.scss +47 -0
  32. data/frameworks/compass/stylesheets/compass/css3/_text-shadow.scss +10 -2
  33. data/frameworks/compass/stylesheets/compass/css3/_transform.scss +34 -17
  34. data/frameworks/compass/stylesheets/compass/css3/_transition.scss +19 -21
  35. data/frameworks/compass/stylesheets/compass/utilities/_print.scss +14 -15
  36. data/frameworks/compass/stylesheets/compass/utilities/general/_clearfix.scss +27 -17
  37. data/frameworks/compass/stylesheets/compass/utilities/general/_float.scss +7 -9
  38. data/frameworks/compass/stylesheets/compass/utilities/general/_hacks.scss +4 -2
  39. data/frameworks/compass/stylesheets/compass/utilities/links/_link-colors.scss +12 -6
  40. data/frameworks/compass/stylesheets/compass/utilities/lists/_bullets.scss +24 -12
  41. data/frameworks/compass/stylesheets/compass/utilities/lists/_horizontal-list.scss +0 -4
  42. data/frameworks/compass/stylesheets/compass/utilities/lists/_inline-list.scss +5 -5
  43. data/frameworks/compass/stylesheets/compass/utilities/sprites/_sprite-img.scss +15 -13
  44. data/frameworks/compass/stylesheets/compass/utilities/text/_replacement.scss +1 -1
  45. data/lib/compass.rb +6 -1
  46. data/lib/compass/commands/help.rb +1 -0
  47. data/lib/compass/configuration/data.rb +10 -2
  48. data/lib/compass/exec/helpers.rb +3 -0
  49. data/lib/compass/sass_extensions/functions/selectors.rb +21 -0
  50. data/lib/compass/version.rb +12 -21
  51. data/test/compass_test.rb +1 -1
  52. data/test/fixtures/stylesheets/blueprint/css/typography.css +8 -19
  53. data/test/fixtures/stylesheets/compass/css/box.css +90 -0
  54. data/test/fixtures/stylesheets/compass/sass/box.sass +50 -0
  55. data/test/sass_extensions_test.rb +19 -26
  56. metadata +42 -62
  57. data/CHANGELOG.markdown +0 -881
  58. data/REVISION +0 -1
  59. data/examples/css3/extensions/compass-colors/README.markdown +0 -50
  60. data/examples/css3/extensions/compass-colors/VERSION.yml +0 -5
  61. data/examples/css3/extensions/compass-colors/example/config.rb +0 -13
  62. data/examples/css3/extensions/compass-colors/example/src/_split_compliment_theme.sass +0 -28
  63. data/examples/css3/extensions/compass-colors/example/src/screen.sass +0 -40
  64. data/examples/css3/extensions/compass-colors/lib/compass-colors.rb +0 -9
  65. data/examples/css3/extensions/compass-colors/lib/compass-colors/compass_extension.rb +0 -7
  66. data/examples/css3/extensions/compass-colors/lib/compass-colors/hsl.rb +0 -109
  67. data/examples/css3/extensions/compass-colors/lib/compass-colors/sass_extensions.rb +0 -112
  68. data/examples/css3/extensions/compass-colors/spec/approximate_color_matching.rb +0 -43
  69. data/examples/css3/extensions/compass-colors/spec/sass_extensions_spec.rb +0 -54
  70. data/examples/css3/extensions/compass-colors/templates/analogous/_theme.sass +0 -28
  71. data/examples/css3/extensions/compass-colors/templates/analogous/manifest.rb +0 -1
  72. data/examples/css3/extensions/compass-colors/templates/basic/_theme.sass +0 -7
  73. data/examples/css3/extensions/compass-colors/templates/basic/manifest.rb +0 -1
  74. data/examples/css3/extensions/compass-colors/templates/complementary/_theme.sass +0 -20
  75. data/examples/css3/extensions/compass-colors/templates/complementary/manifest.rb +0 -1
  76. data/examples/css3/extensions/compass-colors/templates/split_complement/_theme.sass +0 -28
  77. data/examples/css3/extensions/compass-colors/templates/split_complement/manifest.rb +0 -1
  78. data/examples/css3/extensions/compass-colors/templates/triadic/_theme.sass +0 -28
  79. data/examples/css3/extensions/compass-colors/templates/triadic/manifest.rb +0 -1
  80. data/examples/css3/stylesheets/fonts/Vtks Revolt.ttf +0 -0
  81. data/examples/css3/stylesheets/fonts/angelina.ttf +0 -0
  82. data/examples/logo/logo.html.haml +0 -40
  83. data/examples/logo/src/ie.scss +0 -5
  84. data/examples/logo/src/print.scss +0 -3
  85. data/examples/logo/src/screen.scss +0 -28
@@ -7,7 +7,6 @@
7
7
  // the x position of the background image.
8
8
  // @param y
9
9
  // the y position of the background image.
10
-
11
10
  @mixin replace-text($img, $x: 50%, $y: 50%) {
12
11
  @include hide-text;
13
12
  background: {
@@ -15,6 +14,7 @@
15
14
  repeat: no-repeat;
16
15
  position: $x $y; }; }
17
16
 
17
+ // Hides text in an element so you can see the background.
18
18
  @mixin hide-text {
19
19
  text-indent: -9999em;
20
20
  overflow: hidden;
@@ -7,7 +7,12 @@ end
7
7
 
8
8
  module Compass
9
9
  extend Compass::Version
10
- VERSION = "#{version[:major]}.#{version[:minor]}.#{version[:patch]}"
10
+ def self.const_missing(const)
11
+ # This avoid reading from disk unless the VERSION is requested.
12
+ if const == :VERSION
13
+ version[:string]
14
+ end
15
+ end
11
16
  def base_directory
12
17
  File.expand_path(File.join(File.dirname(__FILE__), '..'))
13
18
  end
@@ -58,6 +58,7 @@ To get help on a particular command please specify the command.
58
58
  class << self
59
59
  def option_parser(arguments)
60
60
  parser = Compass::Exec::CommandOptionParser.new(arguments)
61
+ parser.extend(Compass::Exec::GlobalOptionsParser)
61
62
  parser.extend(HelpOptionsParser)
62
63
  end
63
64
  def usage
@@ -62,7 +62,11 @@ module Compass
62
62
  if block_given?
63
63
  @asset_host = block
64
64
  else
65
- @asset_host
65
+ if @asset_host
66
+ @asset_host
67
+ elsif inherited_data.respond_to?(:asset_host)
68
+ inherited_data.asset_host
69
+ end
66
70
  end
67
71
  end
68
72
 
@@ -77,7 +81,11 @@ module Compass
77
81
  if block_given?
78
82
  @asset_cache_buster = block
79
83
  else
80
- @asset_cache_buster
84
+ if @asset_cache_buster
85
+ @asset_cache_buster
86
+ elsif inherited_data.respond_to?(:asset_cache_buster)
87
+ inherited_data.asset_cache_buster
88
+ end
81
89
  end
82
90
  end
83
91
 
@@ -5,6 +5,9 @@ module Compass::Exec
5
5
  if Compass::Commands.command_exists? arguments.first
6
6
  SubCommandUI
7
7
  else
8
+ Compass::Logger.new.red do
9
+ Haml::Util.haml_warn "WARNING: This interface is deprecated. Please use the new subcommand interface.\nSee `compass help` for more information.\n"
10
+ end
8
11
  SwitchUI
9
12
  end
10
13
  end
@@ -39,4 +39,25 @@ module Compass::SassExtensions::Functions::Selectors
39
39
  Sass::Script::String.new(nested)
40
40
  end
41
41
 
42
+ # Return the header selectors for the levels indicated
43
+ # Defaults to all headers h1 through h6
44
+ # For example:
45
+ # headers(all) => h1, h2, h3, h4, h5, h6
46
+ # headers(4) => h1, h2, h3, h4
47
+ # headers(2,4) => h2, h3, h4
48
+ def headers(from = nil, to = nil)
49
+ if from && !to
50
+ if from.is_a?(Sass::Script::String) && from.value == "all"
51
+ from = Sass::Script::Number.new(1)
52
+ to = Sass::Script::Number.new(6)
53
+ else
54
+ to = from
55
+ from = Sass::Script::Number.new(1)
56
+ end
57
+ else
58
+ from ||= Sass::Script::Number.new(1)
59
+ to ||= Sass::Script::Number.new(6)
60
+ end
61
+ Sass::Script::String.new((from.value..to.value).map{|n| "h#{n}"}.join(", "))
62
+ end
42
63
  end
@@ -6,18 +6,12 @@ module Compass
6
6
  # The :rev key will have the current revision hash.
7
7
  #
8
8
  # This method swiped from Haml and then modified, some credit goes to Nathan Weizenbaum
9
- attr_writer :version
10
9
  def version
11
- return @version if defined?(@version)
12
-
13
- read_version_file
14
-
15
- if r = revision
16
- @version[:rev] = r
17
- @version[:string] << " [#{r[0...7]}]"
10
+ if defined?(@version)
11
+ @version
12
+ else
13
+ read_version
18
14
  end
19
-
20
- @version
21
15
  end
22
16
 
23
17
  protected
@@ -26,22 +20,20 @@ module Compass
26
20
  File.join(File.dirname(__FILE__), '..', '..', file)
27
21
  end
28
22
 
29
- def read_version_file
23
+ def read_version
30
24
  require 'yaml'
31
25
  @version = YAML::load(File.read(scope('VERSION.yml')))
32
- @version[:string] = "#{@version[:major]}.#{@version[:minor]}.#{@version[:patch]}"
33
26
  @version[:teeny] = @version[:patch]
27
+ @version[:string] = "#{@version[:major]}.#{@version[:minor]}.#{@version[:patch]}"
28
+ @version[:string] << ".#{@version[:build]}" if @version[:build]
29
+ if !ENV['OFFICIAL'] && r = revision
30
+ @version[:string] << ".dev.#{r[0..6]}"
31
+ end
32
+ @version
34
33
  end
35
34
 
36
35
  def revision
37
- revision_from_git || revision_from_file
38
- end
39
-
40
- def revision_from_file
41
- if File.exists?(scope('REVISION'))
42
- rev = File.read(scope('REVISION')).strip
43
- rev if rev =~ /[a-f0-9]+/
44
- end
36
+ revision_from_git
45
37
  end
46
38
 
47
39
  def revision_from_git
@@ -52,6 +44,5 @@ module Compass
52
44
  end
53
45
  end
54
46
  end
55
-
56
47
  end
57
48
  end
@@ -42,7 +42,7 @@ class CompassTest < Test::Unit::TestCase
42
42
  each_css_file(proj.css_path) do |css_file|
43
43
  assert_no_errors css_file, 'compass'
44
44
  end
45
- assert_renders_correctly :reset, :layout, :utilities, :gradients, :image_size
45
+ assert_renders_correctly :reset, :layout, :utilities, :gradients, :image_size, :box
46
46
  end
47
47
  end
48
48
 
@@ -1,54 +1,43 @@
1
1
  body {
2
2
  line-height: 1.5;
3
- font-family: Helvetica Neue, Arial, Helvetica, sans-serif;
3
+ font-family: "Helvetica Neue", Arial, Helvetica, sans-serif;
4
4
  color: #333333;
5
5
  font-size: 75%; }
6
6
 
7
- h1 {
7
+ h1, h2, h3, h4, h5, h6 {
8
8
  font-weight: normal;
9
- color: #222222;
9
+ color: #222222; }
10
+ h1 img, h2 img, h3 img, h4 img, h5 img, h6 img {
11
+ margin: 0; }
12
+
13
+ h1 {
10
14
  font-size: 3em;
11
15
  line-height: 1;
12
16
  margin-bottom: 0.5em; }
13
- h1 img {
14
- margin: 0; }
15
17
 
16
18
  h2 {
17
- font-weight: normal;
18
- color: #222222;
19
19
  font-size: 2em;
20
20
  margin-bottom: 0.75em; }
21
21
 
22
22
  h3 {
23
- font-weight: normal;
24
- color: #222222;
25
23
  font-size: 1.5em;
26
24
  line-height: 1;
27
25
  margin-bottom: 1em; }
28
26
 
29
27
  h4 {
30
- font-weight: normal;
31
- color: #222222;
32
28
  font-size: 1.2em;
33
29
  line-height: 1.25;
34
30
  margin-bottom: 1.25em; }
35
31
 
36
32
  h5 {
37
- font-weight: normal;
38
- color: #222222;
39
33
  font-size: 1em;
40
34
  font-weight: bold;
41
35
  margin-bottom: 1.5em; }
42
36
 
43
37
  h6 {
44
- font-weight: normal;
45
- color: #222222;
46
38
  font-size: 1em;
47
39
  font-weight: bold; }
48
40
 
49
- h2 img, h3 img, h4 img, h5 img, h6 img {
50
- margin: 0; }
51
-
52
41
  p {
53
42
  margin: 0 0 1.5em; }
54
43
  p img.left {
@@ -107,7 +96,7 @@ pre {
107
96
  white-space: pre; }
108
97
 
109
98
  pre, code, tt {
110
- font: 1em 'andale mono', 'lucida console', monospace;
99
+ font: 1em "andale mono", "lucida console", monospace;
111
100
  line-height: 1.5; }
112
101
 
113
102
  li ul, li ol {
@@ -0,0 +1,90 @@
1
+ .hbox {
2
+ display: -moz-box;
3
+ display: -webkit-box;
4
+ display: box;
5
+ -moz-box-orient: horizontal;
6
+ -webkit-box-orient: horizontal;
7
+ box-orient: horizontal;
8
+ -moz-box-align: stretch;
9
+ -webkit-box-align: stretch;
10
+ box-align: stretch; }
11
+ .hbox > * {
12
+ -moz-box-flex: 0;
13
+ -webkit-box-flex: 0;
14
+ box-flex: 0;
15
+ display: block; }
16
+
17
+ .vbox {
18
+ display: -moz-box;
19
+ display: -webkit-box;
20
+ display: box;
21
+ -moz-box-orient: vertical;
22
+ -webkit-box-orient: vertical;
23
+ box-orient: vertical;
24
+ -moz-box-align: stretch;
25
+ -webkit-box-align: stretch;
26
+ box-align: stretch; }
27
+ .vbox > * {
28
+ -moz-box-flex: 0;
29
+ -webkit-box-flex: 0;
30
+ box-flex: 0;
31
+ display: block; }
32
+
33
+ .spacer {
34
+ -moz-box-flex: 1;
35
+ -webkit-box-flex: 1;
36
+ box-flex: 1;
37
+ display: block; }
38
+
39
+ .reverse {
40
+ -moz-box-direction: reverse;
41
+ -webkit-box-direction: reverse;
42
+ box-direction: reverse; }
43
+
44
+ .box-flex-0 {
45
+ -moz-box-flex: 0;
46
+ -webkit-box-flex: 0;
47
+ box-flex: 0;
48
+ display: block; }
49
+
50
+ .box-flex-1 {
51
+ -moz-box-flex: 1;
52
+ -webkit-box-flex: 1;
53
+ box-flex: 1;
54
+ display: block; }
55
+
56
+ .box-flex-2 {
57
+ -moz-box-flex: 2;
58
+ -webkit-box-flex: 2;
59
+ box-flex: 2;
60
+ display: block; }
61
+
62
+ .box-flex-group-0 {
63
+ -moz-box-flex-group: 0;
64
+ -webkit-box-flex-group: 0;
65
+ box-flex-group: 0; }
66
+
67
+ .box-flex-group-1 {
68
+ -moz-box-flex-group: 1;
69
+ -webkit-box-flex-group: 1;
70
+ box-flex-group: 1; }
71
+
72
+ .box-flex-group-2 {
73
+ -moz-box-flex-group: 2;
74
+ -webkit-box-flex-group: 2;
75
+ box-flex-group: 2; }
76
+
77
+ .start {
78
+ -moz-box-pack: start;
79
+ -webkit-box-pack: start;
80
+ box-pack: start; }
81
+
82
+ .end {
83
+ -moz-box-pack: end;
84
+ -webkit-box-pack: end;
85
+ box-pack: end; }
86
+
87
+ .center {
88
+ -moz-box-pack: center;
89
+ -webkit-box-pack: center;
90
+ box-pack: center; }
@@ -0,0 +1,50 @@
1
+ @import compass/css3
2
+
3
+ .hbox
4
+ +display-box
5
+ +box-orient
6
+ +box-align
7
+
8
+ & > *
9
+ +box-flex
10
+
11
+ .vbox
12
+ +display-box
13
+ +box-orient(vertical)
14
+ +box-align
15
+
16
+ & > *
17
+ +box-flex
18
+
19
+ .spacer
20
+ +box-flex(1)
21
+
22
+ .reverse
23
+ +box-direction(reverse)
24
+
25
+ .box-flex-0
26
+ +box-flex(0)
27
+
28
+ .box-flex-1
29
+ +box-flex(1)
30
+
31
+ .box-flex-2
32
+ +box-flex(2)
33
+
34
+ .box-flex-group-0
35
+ +box-flex-group(0)
36
+
37
+ .box-flex-group-1
38
+ +box-flex-group(1)
39
+
40
+ .box-flex-group-2
41
+ +box-flex-group(2)
42
+
43
+ .start
44
+ +box-pack(start)
45
+
46
+ .end
47
+ +box-pack(end)
48
+
49
+ .center
50
+ +box-pack(center)
@@ -2,50 +2,43 @@ require 'test_helper'
2
2
 
3
3
  class SassExtensionsTest < Test::Unit::TestCase
4
4
  def test_simple
5
- assert_equal "a b", nest("a", "b")
5
+ assert_equal "a b", evaluate(%Q{nest("a", "b")})
6
6
  end
7
7
  def test_left_side_expansion
8
- assert_equal "a c, b c", nest("a, b", "c")
8
+ assert_equal "a c, b c", evaluate(%Q{nest("a, b", "c")})
9
9
  end
10
10
  def test_right_side_expansion
11
- assert_equal "a b, a c", nest("a", "b, c")
11
+ assert_equal "a b, a c", evaluate(%Q{nest("a", "b, c")})
12
12
  end
13
13
  def test_both_sides_expansion
14
- assert_equal "a c, a d, b c, b d", nest("a, b", "c, d")
14
+ assert_equal "a c, a d, b c, b d", evaluate(%Q{nest("a, b", "c, d")})
15
15
  end
16
16
  def test_three_selectors_expansion
17
- assert_equal "a b, a c, a d", nest("a", "b, c, d")
17
+ assert_equal "a b, a c, a d", evaluate(%Q{nest("a", "b, c, d")})
18
18
  end
19
19
  def test_third_argument_expansion
20
- assert_equal "a b e, a b f, a c e, a c f, a d e, a d f", nest("a", "b, c, d", "e, f")
20
+ assert_equal "a b e, a b f, a c e, a c f, a d e, a d f", evaluate(%Q{nest("a", "b, c, d", "e, f")})
21
21
  end
22
22
 
23
23
  def test_enumerate
24
- assert_equal ".grid-1, .grid-2, .grid-3", enumerate(".grid", 1, 3, "-")
24
+ assert_equal ".grid-1, .grid-2, .grid-3", evaluate(%Q{enumerate(".grid", 1, 3, "-")})
25
25
  end
26
26
 
27
27
  def test_append_selector
28
- assert_equal "div.bar", append_selector("div", ".bar")
29
- assert_equal ".foo1.bar1, .foo1.bar2, .foo2.bar1, .foo2.bar2", append_selector(".foo1, .foo2", ".bar1, .bar2")
28
+ assert_equal "div.bar", evaluate(%Q{append_selector("div", ".bar")})
29
+ assert_equal ".foo1.bar1, .foo1.bar2, .foo2.bar1, .foo2.bar2", evaluate(%Q{append_selector(".foo1, .foo2", ".bar1, .bar2")})
30
+ end
31
+
32
+ def test_headers
33
+ assert_equal "h1, h2, h3, h4, h5, h6", evaluate("headers()")
34
+ assert_equal "h1, h2, h3, h4, h5, h6", evaluate("headers(all)")
35
+ assert_equal "h1, h2, h3, h4", evaluate("headers(4)")
36
+ assert_equal "h2, h3", evaluate("headers(2,3)")
37
+ assert_equal "h4, h5, h6", evaluate("headers(4,6)")
30
38
  end
31
39
 
32
40
  protected
33
- def evaluation_content(options)
34
- Sass::Script::Functions::EvaluationContext.new(options)
35
- end
36
- def nest(*arguments)
37
- options = arguments.last.is_a?(Hash) ? arguments.pop : Hash.new
38
- evaluation_content(options).nest(*arguments.map{|a| Sass::Script::String.new(a, :string)}).to_s
39
- end
40
- def enumerate(prefix, from, through, separator = "-", options = {})
41
- prefix = Sass::Script::String.new(prefix, :string)
42
- from = Sass::Script::Number.new(from)
43
- through = Sass::Script::Number.new(through)
44
- separator = Sass::Script::String.new(separator, :string)
45
- evaluation_content(options).enumerate(prefix, from, through, separator).to_s
46
- end
47
- def append_selector(*arguments)
48
- options = arguments.last.is_a?(Hash) ? arguments.pop : Hash.new
49
- evaluation_content(options).append_selector(*arguments.map{|a| Sass::Script::String.new(a, :string)}).to_s
41
+ def evaluate(value)
42
+ Sass::Script::Parser.parse(value, 0, 0).perform(Sass::Environment.new).to_s
50
43
  end
51
44
  end