compass 0.11.alpha.0 → 0.11.alpha.1

Sign up to get free protection for your applications and to get access to all the features.
Files changed (59) hide show
  1. data/VERSION.yml +1 -1
  2. data/examples/compass/headers.txt +7 -0
  3. data/examples/compass/images/border2.png +0 -0
  4. data/examples/compass/images/icon-chrome.png +0 -0
  5. data/examples/compass/images/icon-firefox.png +0 -0
  6. data/examples/compass/images/icon-ie.png +0 -0
  7. data/examples/compass/images/icon-opera.png +0 -0
  8. data/examples/compass/images/icon-safari.png +0 -0
  9. data/examples/compass/pie.html.haml +73 -0
  10. data/examples/compass/src/pie.scss +110 -0
  11. data/features/command_line.feature +11 -33
  12. data/features/step_definitions/command_line_steps.rb +5 -5
  13. data/frameworks/blueprint/templates/project/screen.sass +5 -4
  14. data/frameworks/blueprint/templates/semantic/partials/_page.sass +3 -4
  15. data/frameworks/compass/stylesheets/compass/_css3.scss +16 -1
  16. data/frameworks/compass/stylesheets/compass/_support.scss +2 -0
  17. data/frameworks/compass/stylesheets/compass/css3/_background-clip.scss +1 -1
  18. data/frameworks/compass/stylesheets/compass/css3/_box-shadow.scss +85 -12
  19. data/frameworks/compass/stylesheets/compass/css3/_gradient.scss +6 -13
  20. data/frameworks/compass/stylesheets/compass/css3/_images.scss +42 -2
  21. data/frameworks/compass/stylesheets/compass/css3/_pie.scss +73 -0
  22. data/frameworks/compass/stylesheets/compass/css3/_text-shadow.scss +39 -4
  23. data/frameworks/compass/stylesheets/compass/css3/_transform-legacy.scss +87 -0
  24. data/frameworks/compass/stylesheets/compass/css3/_transform.scss +553 -54
  25. data/frameworks/compass/templates/ellipsis/manifest.rb +3 -3
  26. data/frameworks/compass/templates/extension/manifest.rb +1 -1
  27. data/frameworks/compass/templates/pie/LICENSE +12 -0
  28. data/frameworks/compass/templates/pie/LICENSE-APACHE2.txt +13 -0
  29. data/frameworks/compass/templates/pie/LICENSE-GPL2.txt +278 -0
  30. data/frameworks/compass/templates/pie/PIE.htc +77 -0
  31. data/frameworks/compass/templates/pie/manifest.rb +39 -0
  32. data/frameworks/compass/templates/pie/pie.scss +74 -0
  33. data/lib/compass.rb +1 -1
  34. data/lib/compass/exec/helpers.rb +1 -1
  35. data/lib/compass/installers/base.rb +15 -1
  36. data/lib/compass/rails.rb +2 -0
  37. data/lib/compass/sass_extensions/functions/colors.rb +1 -5
  38. data/lib/compass/sass_extensions/functions/constants.rb +52 -11
  39. data/lib/compass/sass_extensions/functions/gradient_support.rb +382 -190
  40. data/lib/compass/sass_extensions/functions/if.rb +2 -2
  41. data/lib/compass/sass_extensions/functions/lists.rb +2 -0
  42. data/lib/compass/sass_extensions/functions/urls.rb +1 -1
  43. data/lib/compass/util.rb +18 -0
  44. data/test/fixtures/stylesheets/compass/css/gradients.css +110 -85
  45. data/test/fixtures/stylesheets/compass/css/pie.css +25 -0
  46. data/test/fixtures/stylesheets/compass/css/text_shadow.css +14 -0
  47. data/test/fixtures/stylesheets/compass/sass/box.sass +1 -1
  48. data/test/fixtures/stylesheets/compass/sass/box_shadow.scss +2 -2
  49. data/test/fixtures/stylesheets/compass/sass/gradients.sass +1 -1
  50. data/test/fixtures/stylesheets/compass/sass/pie.scss +47 -0
  51. data/test/fixtures/stylesheets/compass/sass/text_shadow.scss +7 -0
  52. data/test/fixtures/stylesheets/compass/sass/transform.scss +1 -1
  53. metadata +30 -9
  54. data/frameworks/compass/stylesheets/compass/css3/_box-shadow-v2.scss +0 -98
  55. data/frameworks/compass/stylesheets/compass/css3/_text-shadow-v2.scss +0 -72
  56. data/frameworks/compass/stylesheets/compass/css3/_transform-v2.scss +0 -584
  57. data/frameworks/compass/stylesheets/compass/css3/_version-1.scss +0 -16
  58. data/frameworks/compass/stylesheets/compass/css3/_version-2.scss +0 -16
  59. data/lib/rails/init.rb +0 -2
@@ -2,4 +2,4 @@
2
2
  :major: 0
3
3
  :minor: 11
4
4
  :state: alpha
5
- :build: 0
5
+ :build: 1
@@ -0,0 +1,7 @@
1
+ HTTP/1.1 200 OK
2
+ Connection: close
3
+ Date: Thu, 18 Nov 2010 17:15:33 GMT
4
+ Last-Modified: Thu, 18 Nov 2010 01:45:54 GMT
5
+ Content-Type: text/x-component
6
+ Content-Length: 28280
7
+
@@ -0,0 +1,73 @@
1
+ !!! 5
2
+ %html
3
+ %head
4
+ %meta{:content => "text/html; charset=UTF-8", "http-equiv" => "content-type"}/
5
+ %title Basic CSS3 Demos
6
+ %link{:charset => "utf-8", :href => "stylesheets/pie.css", :media => "screen", :rel => "stylesheet", :type => "text/css"}/
7
+ %body
8
+ .section
9
+ %h2 border-radius
10
+ #test1.test Cherry
11
+ %code
12
+ %strong
13
+ border-radius: 1em; /* Standard */
14
+ \-moz-border-radius: 1em; /* Gecko */
15
+ \-webkit-border-radius: 1em; /* WebKit */
16
+ .section
17
+ %h2 box-shadow
18
+ #test2.test Apple
19
+ %code
20
+ border-radius: 1em;
21
+ \-moz-border-radius: 1em;
22
+ \-webkit-border-radius: 1em;
23
+ %strong
24
+ box-shadow: #999 0 .25em .5em;
25
+ \-webkit-box-shadow: #999 0 .25em .5em;
26
+ \-moz-box-shadow: #999 0 .25em .5em;
27
+ .section
28
+ %h2 linear-gradient
29
+ #test3.test Blueberry
30
+ %code
31
+ border-radius: 1em;
32
+ \-moz-border-radius: 1em;
33
+ \-webkit-border-radius: 1em;
34
+ box-shadow: #999 0 .25em .5em;
35
+ \-webkit-box-shadow: #999 0 .25em .5em;
36
+ \-moz-box-shadow: #999 0 .25em .5em;
37
+ %strong
38
+ background: #9CF; /* Fallback */
39
+ background: -webkit-gradient(linear, 0 0, 0 100%, from(#9CF), to(#03C));
40
+ background: -moz-linear-gradient(#9CF, #03C);
41
+ background: linear-gradient(#9CF, #03C);
42
+ .section
43
+ %h2 multiple background images
44
+ #test4.test Rhubarb
45
+ %code
46
+ border-radius: 1em;
47
+ \-moz-border-radius: 1em;
48
+ \-webkit-border-radius: 1em;
49
+ box-shadow: #999 0 .25em .5em;
50
+ \-webkit-box-shadow: #999 0 .25em .5em;
51
+ \-moz-box-shadow: #999 0 .25em .5em;
52
+ %strong
53
+ background: url(icon-ie.png) no-repeat 50% 0 #FFF; /* Fallback */
54
+ background: url(icon-ie.png) no-repeat 50% 0,
55
+ url(icon-firefox.png) no-repeat 0 0,
56
+ url(icon-chrome.png) no-repeat 100% 0,
57
+ url(icon-safari.png) no-repeat 0 100%,
58
+ url(icon-opera.png) no-repeat 100% 100% #FFF;
59
+ .section
60
+ %h2 border-image
61
+ #test5.test Pumpkin
62
+ %code
63
+ border-radius: 1em;
64
+ \-moz-border-radius: 1em;
65
+ \-webkit-border-radius: 1em;
66
+ box-shadow: #999 0 .25em .5em;
67
+ \-webkit-box-shadow: #999 0 .25em .5em;
68
+ \-moz-box-shadow: #999 0 .25em .5em;
69
+ %strong
70
+ border-image: url(border2.png) 15 fill stretch;
71
+ \-moz-border-image: url(border2.png) 15 stretch;
72
+ \-webkit-border-image: url(border2.png) 15 stretch;
73
+ border: 15px solid transparent;
@@ -0,0 +1,110 @@
1
+ // this file demonstrates how to use the CSS PIE extension for
2
+ // legacy versions of Internet Explorer. In many cases, PIE will allow
3
+ // you to style in CSS things that you'd have to do using image chops otherwise.
4
+ //
5
+ // Note: Each element that has PIE enabled on it will add about 10ms to your page load.
6
+ @import "compass/css3";
7
+ @import "compass/css3/pie";
8
+
9
+ $pie-behavior: url("/stylesheets/PIE.htc");
10
+
11
+ // It is suggested that you use Sass's @extend directive to apply the PIE
12
+ // behavior to your elements. Setting this variable will tell the `pie` mixin
13
+ // to extend. Or you can just extend the base class yourself.
14
+ $pie-base-class: pie-element;
15
+
16
+ // There are two approaches to creating PIE elements
17
+ // The default approach is to make the element position: relative.
18
+ .pie-element {
19
+ // relative is the default, so passing relative
20
+ // is redundant, but we do it here for clarity.
21
+ @include pie-element(relative);
22
+ }
23
+
24
+ html, body {
25
+ margin: 0;
26
+ padding: 0;
27
+ font-family: sans-serif;
28
+ font-size: 16px;
29
+ background: #EEE;
30
+ }
31
+
32
+ .section {
33
+ border: 1px solid #CCC;
34
+ padding: 1em 2em 2em;
35
+ margin: 3em;
36
+ background: #FFF;
37
+ }
38
+
39
+ .section h2 {
40
+ border: 1px solid #CCC;
41
+ position: relative;
42
+ left: -3em;
43
+ top: -2em;
44
+ background: #FFF;
45
+ font-size: 1em;
46
+ padding: .25em 1em;
47
+ margin: 0;
48
+ }
49
+
50
+ .section code {
51
+ display: block;
52
+ white-space: pre;
53
+ margin-left: 250px;
54
+ min-height: 100px;
55
+ color: #999;
56
+ overflow: auto;
57
+ }
58
+ .section code strong {
59
+ color: #000;
60
+ }
61
+
62
+ .test {
63
+ width: 200px;
64
+ height: 100px;
65
+ line-height: 100px;
66
+ text-align: center;
67
+ border: 2px solid;
68
+ background: #FFF;
69
+ float: left;
70
+ @include pie;
71
+ }
72
+
73
+ #test1 {
74
+ border-color: #c00;
75
+ @include border-radius(1em);
76
+ }
77
+
78
+ #test2 {
79
+ border-color: #090;
80
+ @include border-radius(1em);
81
+ @include box-shadow(#999 0 .25em .5em);
82
+ }
83
+
84
+ #test3 {
85
+ border-color: #00c;
86
+ @include border-radius(1em);
87
+ @include box-shadow(#999 0 .25em .5em);
88
+ @include background(linear-gradient(#9CF, #03C));
89
+ }
90
+
91
+ #test4 {
92
+ border-color: #F99;
93
+ @include border-radius(1em);
94
+ @include box-shadow(#999 0 .25em .5em);
95
+ background: #FFF image-url("icon-ie.png") no-repeat 50% 0;
96
+ @include background(
97
+ image-url("icon-ie.png") no-repeat 50% 0,
98
+ image-url("icon-firefox.png") no-repeat 0 0,
99
+ image-url("icon-chrome.png") no-repeat 100% 0,
100
+ image-url("icon-safari.png") no-repeat 0 100%,
101
+ image-url("icon-opera.png") no-repeat 100% 100% #FFF
102
+ );
103
+ }
104
+
105
+ #test5 {
106
+ @include border-image(image-url("border2.png") 15 stretch);
107
+ border: 15px solid transparent;
108
+ width: 180px;
109
+ }
110
+
@@ -7,12 +7,9 @@ Feature: Command Line
7
7
  When I create a project using: compass create my_project
8
8
  Then a directory my_project/ is created
9
9
  And a configuration file my_project/config.rb is created
10
- And a sass file my_project/src/screen.scss is created
11
- And a sass file my_project/src/print.scss is created
12
- And a sass file my_project/src/ie.scss is created
13
- And a sass file my_project/src/screen.scss is compiled
14
- And a sass file my_project/src/print.scss is compiled
15
- And a sass file my_project/src/ie.scss is compiled
10
+ And a sass file my_project/sass/screen.scss is created
11
+ And a sass file my_project/sass/print.scss is created
12
+ And a sass file my_project/sass/ie.scss is created
16
13
  And a css file my_project/stylesheets/screen.css is created
17
14
  And a css file my_project/stylesheets/print.css is created
18
15
  And a css file my_project/stylesheets/ie.css is created
@@ -24,12 +21,9 @@ Feature: Command Line
24
21
  When I create a project using: compass create bp_project --using blueprint
25
22
  Then a directory bp_project/ is created
26
23
  And a configuration file bp_project/config.rb is created
27
- And a sass file bp_project/src/screen.scss is created
28
- And a sass file bp_project/src/print.scss is created
29
- And a sass file bp_project/src/ie.scss is created
30
- And a sass file bp_project/src/screen.scss is compiled
31
- And a sass file bp_project/src/print.scss is compiled
32
- And a sass file bp_project/src/ie.scss is compiled
24
+ And a sass file bp_project/sass/screen.scss is created
25
+ And a sass file bp_project/sass/print.scss is created
26
+ And a sass file bp_project/sass/ie.scss is created
33
27
  And a css file bp_project/stylesheets/screen.css is created
34
28
  And a css file bp_project/stylesheets/print.css is created
35
29
  And a css file bp_project/stylesheets/ie.css is created
@@ -52,9 +46,9 @@ Feature: Command Line
52
46
  When I create a project using: compass create my_project --dry-run
53
47
  Then a directory my_project/ is not created
54
48
  But a configuration file my_project/config.rb is reported created
55
- And a sass file my_project/src/screen.scss is reported created
56
- And a sass file my_project/src/print.scss is reported created
57
- And a sass file my_project/src/ie.scss is reported created
49
+ And a sass file my_project/sass/screen.scss is reported created
50
+ And a sass file my_project/sass/print.scss is reported created
51
+ And a sass file my_project/sass/ie.scss is reported created
58
52
  And I am told how to link to /stylesheets/screen.css for media "screen, projection"
59
53
  And I am told how to link to /stylesheets/print.css for media "print"
60
54
  And I am told how to conditionally link "IE" to /stylesheets/ie.css for media "screen, projection"
@@ -63,10 +57,10 @@ Feature: Command Line
63
57
  When I create a project using: compass create bare_project --bare
64
58
  Then a directory bare_project/ is created
65
59
  And a configuration file bare_project/config.rb is created
66
- And a directory bare_project/src/ is created
60
+ And a directory bare_project/sass/ is created
67
61
  And a directory bare_project/stylesheets/ is not created
68
62
  And I am congratulated
69
- And I am told that I can place stylesheets in the src subdirectory
63
+ And I am told that I can place stylesheets in the sass subdirectory
70
64
  And I am told how to compile my sass stylesheets
71
65
 
72
66
  Scenario: Creating a bare project with a framework
@@ -87,10 +81,6 @@ Feature: Command Line
87
81
  Given I am using the existing project in test/fixtures/stylesheets/compass
88
82
  When I run: compass compile
89
83
  Then a directory tmp/ is created
90
- And a sass file sass/layout.sass is reported compiled
91
- And a sass file sass/print.sass is reported compiled
92
- And a sass file sass/reset.sass is reported compiled
93
- And a sass file sass/utilities.scss is reported compiled
94
84
  And a css file tmp/layout.css is created
95
85
  And a css file tmp/print.css is created
96
86
  And a css file tmp/reset.css is created
@@ -101,10 +91,6 @@ Feature: Command Line
101
91
  And I am in the parent directory
102
92
  When I run: compass compile tmp_compass
103
93
  Then a directory tmp_compass/tmp/ is created
104
- And a sass file tmp_compass/sass/layout.sass is reported compiled
105
- And a sass file tmp_compass/sass/print.sass is reported compiled
106
- And a sass file tmp_compass/sass/reset.sass is reported compiled
107
- And a sass file tmp_compass/sass/utilities.scss is reported compiled
108
94
  And a css file tmp_compass/tmp/layout.css is created
109
95
  And a css file tmp_compass/tmp/print.css is created
110
96
  And a css file tmp_compass/tmp/reset.css is created
@@ -114,10 +100,6 @@ Feature: Command Line
114
100
  Given I am using the existing project in test/fixtures/stylesheets/compass
115
101
  When I run: compass compile --dry-run
116
102
  Then a directory tmp/ is not created
117
- And a sass file sass/layout.sass is reported compiled
118
- And a sass file sass/print.sass is reported compiled
119
- And a sass file sass/reset.sass is reported compiled
120
- And a sass file sass/utilities.scss is reported compiled
121
103
  And a css file tmp/layout.css is not created
122
104
  And a css file tmp/print.css is not created
123
105
  And a css file tmp/reset.css is not created
@@ -142,7 +124,6 @@ Feature: Command Line
142
124
  Then a sass file sass/layout.sass is not mentioned
143
125
  And a sass file sass/print.sass is not mentioned
144
126
  And a sass file sass/reset.sass is not mentioned
145
- And a sass file sass/utilities.scss is reported compiled
146
127
  And a css file tmp/utilities.css is reported created
147
128
  And a css file tmp/utilities.css is created
148
129
 
@@ -153,7 +134,6 @@ Feature: Command Line
153
134
  Then a sass file sass/layout.sass is not mentioned
154
135
  And a sass file sass/print.sass is not mentioned
155
136
  And a sass file sass/reset.sass is not mentioned
156
- And a sass file sass/utilities.scss is reported compiled
157
137
  And a css file tmp/utilities.css is reported identical
158
138
 
159
139
  Scenario: Installing a pattern into a project
@@ -191,7 +171,6 @@ Feature: Command Line
191
171
  And I wait 1 second
192
172
  And I touch sass/layout.sass
193
173
  And I run: compass compile
194
- Then a sass file sass/layout.sass is reported compiled
195
174
  Then a css file tmp/layout.css is reported identical
196
175
  And a sass file sass/print.sass is reported unchanged
197
176
  And a sass file sass/reset.sass is reported unchanged
@@ -203,7 +182,6 @@ Feature: Command Line
203
182
  And I wait 1 second
204
183
  And I add some sass to sass/layout.sass
205
184
  And I run: compass compile
206
- Then a sass file sass/layout.sass is reported compiled
207
185
  And a css file tmp/layout.css is reported overwritten
208
186
  And a sass file sass/print.sass is reported unchanged
209
187
  And a sass file sass/reset.sass is reported unchanged
@@ -115,23 +115,23 @@ Then /an? \w+ file ([^ ]+) is (not )?created/ do |filename, negated|
115
115
  end
116
116
 
117
117
  Then /an? \w+ file ([^ ]+) is reported created/ do |filename|
118
- @last_result.should =~ /create #{Regexp.escape(filename)}/
118
+ @last_result.should =~ /create.*#{Regexp.escape(filename)}/
119
119
  end
120
120
 
121
121
  Then /a \w+ file ([^ ]+) is (?:reported )?compiled/ do |filename|
122
- @last_result.should =~ /compile #{Regexp.escape(filename)}/
122
+ @last_result.should =~ /compile.*#{Regexp.escape(filename)}/
123
123
  end
124
124
 
125
125
  Then /a \w+ file ([^ ]+) is reported unchanged/ do |filename|
126
- @last_result.should =~ /unchanged #{Regexp.escape(filename)}/
126
+ @last_result.should =~ /unchanged.*#{Regexp.escape(filename)}/
127
127
  end
128
128
 
129
129
  Then /a \w+ file ([^ ]+) is reported identical/ do |filename|
130
- @last_result.should =~ /identical #{Regexp.escape(filename)}/
130
+ @last_result.should =~ /identical.*#{Regexp.escape(filename)}/
131
131
  end
132
132
 
133
133
  Then /a \w+ file ([^ ]+) is reported overwritten/ do |filename|
134
- @last_result.should =~ /overwrite #{Regexp.escape(filename)}/
134
+ @last_result.should =~ /overwrite.*#{Regexp.escape(filename)}/
135
135
  end
136
136
 
137
137
  Then /a \w+ file ([^ ]+) is not mentioned/ do |filename|
@@ -11,10 +11,9 @@
11
11
  // configuration applied, uncomment:
12
12
  // @include blueprint
13
13
 
14
- // But Compass recommends that you scope your blueprint styles
15
- // So that you can better control what pages use blueprint
16
- // when stylesheets are concatenated together.
17
- +blueprint-scaffolding("body.bp")
14
+ // If you are doing a lot of stylesheet concatenation, it is suggested
15
+ // that you scope your blueprint styles, so that you can better control
16
+ // what pages use blueprint when stylesheets are concatenated together.
18
17
  body.bp
19
18
  +blueprint-typography(true)
20
19
  +blueprint-utilities
@@ -24,6 +23,8 @@ body.bp
24
23
  // Or leave it in if you're happy with how blueprint looks out-of-the-box
25
24
  form.bp
26
25
  +blueprint-form
26
+ // You'll probably want to remove the scaffolding once you start styling your site.
27
+ +blueprint-scaffolding
27
28
 
28
29
  // Page layout can be done using mixins applied to your semantic classes and IDs:
29
30
  body.two-col
@@ -11,8 +11,7 @@ body.bp
11
11
  +blueprint-utilities
12
12
  +blueprint-debug
13
13
  +blueprint-interaction
14
-
15
- // Remove the scaffolding when you're ready to start doing visual design.
16
- // Or leave it in if you're happy with how blueprint looks out-of-the-box
17
- +blueprint-scaffolding("body.bp")
14
+ // Remove the scaffolding when you're ready to start doing visual design.
15
+ // Or leave it in if you're happy with how blueprint looks out-of-the-box
16
+ +blueprint-scaffolding
18
17
 
@@ -1 +1,16 @@
1
- @import "css3/version-1";
1
+ @import "css3/border-radius";
2
+ @import "css3/inline-block";
3
+ @import "css3/opacity";
4
+ @import "css3/box-shadow";
5
+ @import "css3/text-shadow";
6
+ @import "css3/columns";
7
+ @import "css3/box-sizing";
8
+ @import "css3/box";
9
+ @import "css3/gradient";
10
+ @import "css3/images";
11
+ @import "css3/background-clip";
12
+ @import "css3/background-origin";
13
+ @import "css3/background-size";
14
+ @import "css3/font-face";
15
+ @import "css3/transform";
16
+ @import "css3/transition";
@@ -27,3 +27,5 @@ $experimental-support-for-khtml : true !default;
27
27
  // Setting this to true might add significant size to your
28
28
  // generated stylesheets.
29
29
  $experimental-support-for-svg : false !default;
30
+ // Support for CSS PIE in experimental css3 properties.
31
+ $experimental-support-for-pie : false !default;
@@ -5,7 +5,7 @@
5
5
  // If you wish to do so, you can override the default constant with `border-box`
6
6
  //
7
7
  // To override to the default border-box model, use this code:
8
- // $default-background-clip = border-box
8
+ // $default-background-clip: border-box
9
9
 
10
10
  $default-background-clip: padding-box !default;
11
11
 
@@ -1,17 +1,90 @@
1
- @import "box-shadow-v2";
1
+ // @doc off
2
+ // These defaults make the arguments optional for this mixin
3
+ // If you like, set different defaults before importing.
4
+ // @doc on
2
5
 
3
- // This mixin is deprecated.
4
- // Use the box-shadow mixin from compass/css3/box-shadow-v2 instead.
5
- // @deprecated
6
+ @import "shared";
7
+
8
+
9
+ // The default color for box shadows
10
+ $default-box-shadow-color: #333333 !default;
11
+
12
+ // The default horizontal offset. Positive is to the right.
13
+ $default-box-shadow-h-offset: 0px !default;
14
+
15
+ // The default vertical offset. Positive is down.
16
+ $default-box-shadow-v-offset: 0px !default;
17
+
18
+ // The default blur length.
19
+ $default-box-shadow-blur: 5px !default;
20
+
21
+ // The default spread length.
22
+ $default-box-shadow-spread : false !default;
23
+
24
+ // The default shadow inset: inset or false (for standard shadow).
25
+ $default-box-shadow-inset : false !default;
26
+
27
+ // Provides cross-browser for Webkit, Gecko, and CSS3 box shadows when one or more box shadows are needed.
6
28
  @mixin box-shadow(
7
- $color : $default-box-shadow-color,
8
- $hoff : $default-box-shadow-h-offset,
9
- $voff : $default-box-shadow-v-offset,
10
- $blur : $default-box-shadow-blur,
11
- $spread : $default-box-shadow-spread,
12
- $inset : $default-box-shadow-inset
29
+ $shadow-1 : default,
30
+ $shadow-2 : false,
31
+ $shadow-3 : false,
32
+ $shadow-4 : false,
33
+ $shadow-5 : false,
34
+ $shadow-6 : false,
35
+ $shadow-7 : false,
36
+ $shadow-8 : false,
37
+ $shadow-9 : false,
38
+ $shadow-10: false
13
39
  ) {
14
- @warn "This version of the box-shadow mixin has been deprecated. Please read: http://compass-style.org/docs/upgrading/css3-v2/#box-shadow for details.";
15
- @include single-box-shadow($color, $hoff, $voff, $blur, $spread, $inset);
40
+ // This has to be on a single line due to a bug in the scss parser: https://github.com/nex3/sass/issues/issue/26
41
+ $legacy: (type-of($shadow-1) == color and type-of(if($shadow-2, $shadow-2, 0)) == number and type-of(if($shadow-3, $shadow-3, 0)) == number and type-of(if($shadow-4, $shadow-4, 0)) == number and type-of(if($shadow-5, $shadow-5, 0)) == number and ($shadow-6 == inset or type-of($shadow-6) == bool) and ($shadow-2 or $shadow-3 or $shadow-4 or $shadow-5 or $shadow-6));
42
+ @if $legacy {
43
+ @warn "Passing separate arguments for a single shadow to box-shadow is deprecated. " +
44
+ "Pass the values as a single space-separated list, or use the single-box-shadow mixin. " +
45
+ "See http://beta.compass-style.org/help/tutorials/upgrading/antares/ for more info.";
46
+ @include single-box-shadow(
47
+ if($shadow-1, $shadow-1, $default-box-shadow-color),
48
+ if($shadow-2, $shadow-2, $default-box-shadow-h-offset),
49
+ if($shadow-3, $shadow-3, $default-box-shadow-v-offset),
50
+ if($shadow-4, $shadow-4, $default-box-shadow-blur),
51
+ if($shadow-5, $shadow-5, $default-box-shadow-spread),
52
+ if($shadow-6, $shadow-6, $default-box-shadow-inset)
53
+ );
54
+ }
55
+ @else {
56
+ @if $shadow-1 == default {
57
+ $shadow-1 : -compass-space-list(compact(if($default-box-shadow-inset, inset), $default-box-shadow-h-offset, $default-box-shadow-v-offset, $default-box-shadow-blur, $default-box-shadow-spread, $default-box-shadow-color));
58
+ }
59
+ $shadow : compact($shadow-1, $shadow-2, $shadow-3, $shadow-4, $shadow-5, $shadow-6, $shadow-7, $shadow-8, $shadow-9, $shadow-10);
60
+ @include experimental(box-shadow, $shadow,
61
+ -moz, -webkit, -o, not -ms, not -khtml, official
62
+ );
63
+ }
16
64
  }
17
65
 
66
+ // Provides a single cross-browser CSS box shadow for Webkit, Gecko, and CSS3.
67
+ // Includes default arguments for color, horizontal offset, vertical offset, blur length, spread length, and inset.
68
+ @mixin single-box-shadow(
69
+ $color : $default-box-shadow-color,
70
+ $hoff : $default-box-shadow-h-offset,
71
+ $voff : $default-box-shadow-v-offset,
72
+ $blur : $default-box-shadow-blur,
73
+ $spread : $default-box-shadow-spread,
74
+ $inset : $default-box-shadow-inset
75
+ ) {
76
+ @if not ($inset == true or $inset == false or $inset == inset) {
77
+ @warn "$inset expected to be true or the inset keyword. Got #{$inset} instead. Using: inset";
78
+ }
79
+
80
+ @if $color == none {
81
+ @include box-shadow(none);
82
+ } @else {
83
+ $full : $hoff $voff;
84
+ @if $blur { $full: $full $blur; }
85
+ @if $spread { $full: $full $spread; }
86
+ @if $color { $full: $full $color; }
87
+ @if $inset { $full: inset $full; }
88
+ @include box-shadow($full);
89
+ }
90
+ }