compass 0.13.alpha.4 → 0.13.alpha.5

Sign up to get free protection for your applications and to get access to all the features.
Files changed (156) hide show
  1. checksums.yaml +7 -0
  2. data/README.markdown +2 -3
  3. data/Rakefile +91 -5
  4. data/VERSION.yml +1 -1
  5. data/examples/compass/images/emblem-a043c4f148.png +0 -0
  6. data/examples/compass/images/flag-03c3b29b35.png +0 -0
  7. data/examples/compass/images/flag-21cfbfbfc8.png +0 -0
  8. data/examples/css3/extensions/fancy-fonts/templates/project/Prociono.otf +0 -0
  9. data/features/command_line.feature +2 -6
  10. data/features/step_definitions/command_line_steps.rb +1 -0
  11. data/frameworks/compass/stylesheets/compass/_css3.scss +0 -1
  12. data/frameworks/compass/stylesheets/compass/_support.scss +353 -35
  13. data/frameworks/compass/stylesheets/compass/css3/_animation.scss +49 -48
  14. data/frameworks/compass/stylesheets/compass/css3/_appearance.scss +4 -8
  15. data/frameworks/compass/stylesheets/compass/css3/_background-clip.scss +15 -19
  16. data/frameworks/compass/stylesheets/compass/css3/_background-origin.scss +17 -19
  17. data/frameworks/compass/stylesheets/compass/css3/_background-size.scss +4 -8
  18. data/frameworks/compass/stylesheets/compass/css3/_border-radius.scss +37 -39
  19. data/frameworks/compass/stylesheets/compass/css3/_box-shadow.scss +45 -20
  20. data/frameworks/compass/stylesheets/compass/css3/_box-sizing.scss +6 -8
  21. data/frameworks/compass/stylesheets/compass/css3/_box.scss +12 -13
  22. data/frameworks/compass/stylesheets/compass/css3/_columns.scss +46 -26
  23. data/frameworks/compass/stylesheets/compass/css3/_deprecated-support.scss +272 -0
  24. data/frameworks/compass/stylesheets/compass/css3/_filter.scss +17 -10
  25. data/frameworks/compass/stylesheets/compass/css3/_flexbox.scss +134 -281
  26. data/frameworks/compass/stylesheets/compass/css3/_font-face.scss +5 -5
  27. data/frameworks/compass/stylesheets/compass/css3/_hyphenation.scss +14 -11
  28. data/frameworks/compass/stylesheets/compass/css3/_images.scss +77 -67
  29. data/frameworks/compass/stylesheets/compass/css3/_inline-block.scss +15 -6
  30. data/frameworks/compass/stylesheets/compass/css3/_opacity.scss +6 -2
  31. data/frameworks/compass/stylesheets/compass/css3/_pie.scss +1 -73
  32. data/frameworks/compass/stylesheets/compass/css3/_regions.scss +7 -6
  33. data/frameworks/compass/stylesheets/compass/css3/_selection.scss +45 -17
  34. data/frameworks/compass/stylesheets/compass/css3/_shared.scss +4 -261
  35. data/frameworks/compass/stylesheets/compass/css3/_text-shadow.scss +1 -1
  36. data/frameworks/compass/stylesheets/compass/css3/_transform.scss +24 -32
  37. data/frameworks/compass/stylesheets/compass/css3/_transition.scss +102 -152
  38. data/frameworks/compass/stylesheets/compass/css3/_user-interface.scss +42 -27
  39. data/frameworks/compass/stylesheets/compass/typography/_vertical_rhythm.scss +2 -1
  40. data/frameworks/compass/stylesheets/compass/typography/links/_hover-link.scss +1 -1
  41. data/frameworks/compass/stylesheets/compass/typography/lists/_horizontal-list.scss +2 -2
  42. data/frameworks/compass/stylesheets/compass/typography/lists/_inline-list.scss +1 -1
  43. data/frameworks/compass/stylesheets/compass/typography/text/_ellipsis.scss +1 -1
  44. data/frameworks/compass/stylesheets/compass/utilities/_sass.scss +2 -0
  45. data/frameworks/compass/stylesheets/compass/utilities/color/_brightness.scss +12 -0
  46. data/frameworks/compass/stylesheets/compass/utilities/color/_contrast.scss +36 -12
  47. data/frameworks/compass/stylesheets/compass/utilities/general/_float.scss +6 -2
  48. data/frameworks/compass/stylesheets/compass/utilities/general/_hacks.scss +23 -4
  49. data/frameworks/compass/stylesheets/compass/utilities/general/_min.scss +1 -1
  50. data/frameworks/compass/stylesheets/compass/utilities/sass/_lists.scss +16 -0
  51. data/frameworks/compass/stylesheets/compass/utilities/sass/_maps.scss +19 -0
  52. data/frameworks/compass/stylesheets/compass/utilities/sprites/_base.scss +25 -18
  53. data/frameworks/compass/stylesheets/compass/utilities/sprites/_sprite-img.scss +3 -1
  54. data/frameworks/compass/stylesheets/compass/utilities/tables/_borders.scss +3 -3
  55. data/lib/compass.rb +1 -1
  56. data/lib/compass/browser_support.rb +1 -1
  57. data/lib/compass/caniuse.rb +247 -0
  58. data/lib/compass/configuration/adapters.rb +7 -1
  59. data/lib/compass/sass_extensions/functions.rb +5 -0
  60. data/lib/compass/sass_extensions/functions/constants.rb +2 -2
  61. data/lib/compass/sass_extensions/functions/cross_browser_support.rb +176 -1
  62. data/lib/compass/sass_extensions/functions/display.rb +24 -19
  63. data/lib/compass/sass_extensions/functions/env.rb +37 -8
  64. data/lib/compass/sass_extensions/functions/gradient_support.rb +10 -13
  65. data/lib/compass/sass_extensions/functions/math.rb +31 -13
  66. data/lib/compass/sass_extensions/functions/sprites.rb +48 -25
  67. data/lib/compass/sass_extensions/monkey_patches/browser_support.rb +42 -13
  68. data/lib/compass/sass_extensions/sprites/image.rb +14 -4
  69. data/lib/compass/sass_extensions/sprites/image_methods.rb +19 -3
  70. data/lib/compass/sprite_importer/content.erb +8 -7
  71. data/lib/compass/watcher/project_watcher.rb +75 -42
  72. data/lib/compass/watcher/watch.rb +35 -17
  73. data/test/fixtures/sprites/public/images/focus/ten-by-ten.png +0 -0
  74. data/test/fixtures/sprites/public/images/focus/ten-by-ten_active.png +0 -0
  75. data/test/fixtures/sprites/public/images/focus/ten-by-ten_focus.png +0 -0
  76. data/test/fixtures/sprites/public/images/focus/ten-by-ten_hover.png +0 -0
  77. data/test/fixtures/sprites/public/images/focus/ten-by-ten_target.png +0 -0
  78. data/test/fixtures/stylesheets/compass/config.rb +1 -0
  79. data/test/fixtures/stylesheets/compass/css/animation-with-legacy-ie.css +1 -9
  80. data/test/fixtures/stylesheets/compass/css/animation.css +1 -9
  81. data/test/fixtures/stylesheets/compass/css/appearance.css +3 -0
  82. data/test/fixtures/stylesheets/compass/css/background-clip.css +4 -8
  83. data/test/fixtures/stylesheets/compass/css/background-origin.css +4 -8
  84. data/test/fixtures/stylesheets/compass/css/background-size.css +3 -10
  85. data/test/fixtures/stylesheets/compass/css/border_radius.css +3 -3
  86. data/test/fixtures/stylesheets/compass/css/{box-sizeing.css → box-sizing.css} +2 -2
  87. data/test/fixtures/stylesheets/compass/css/box_shadow.css +15 -5
  88. data/test/fixtures/stylesheets/compass/css/brightness.css +14 -0
  89. data/test/fixtures/stylesheets/compass/css/browser-support.css +306 -0
  90. data/test/fixtures/stylesheets/compass/css/color.css +18 -0
  91. data/test/fixtures/stylesheets/compass/css/columns.css +27 -18
  92. data/test/fixtures/stylesheets/compass/css/filters.css +6 -6
  93. data/test/fixtures/stylesheets/compass/css/flexbox.css +84 -111
  94. data/test/fixtures/stylesheets/compass/css/fonts.css +1 -1
  95. data/test/fixtures/stylesheets/compass/css/gradients.css +53 -53
  96. data/test/fixtures/stylesheets/compass/css/grid_background.css +11 -11
  97. data/test/fixtures/stylesheets/compass/css/hyphenation.css +2 -4
  98. data/test/fixtures/stylesheets/compass/css/lists.css +6 -12
  99. data/test/fixtures/stylesheets/compass/css/regions.css +2 -2
  100. data/test/fixtures/stylesheets/compass/css/selection.css +41 -4
  101. data/test/fixtures/stylesheets/compass/css/sprites_with_explicit_separator.css +16 -0
  102. data/test/fixtures/stylesheets/compass/css/support.css +62 -0
  103. data/test/fixtures/stylesheets/compass/css/transform.css +64 -136
  104. data/test/fixtures/stylesheets/compass/css/transition.css +27 -45
  105. data/test/fixtures/stylesheets/compass/css/typography/links/hover-link.css +4 -0
  106. data/test/fixtures/stylesheets/compass/css/user-interface.css +34 -7
  107. data/test/fixtures/stylesheets/compass/css/utilities.css +7 -7
  108. data/test/fixtures/stylesheets/compass/css/vertical_rhythm.css +6 -9
  109. data/test/fixtures/stylesheets/compass/images/flag_states-sc42d7bf926.png +0 -0
  110. data/test/fixtures/stylesheets/compass/images/flag_states/foo.png +0 -0
  111. data/test/fixtures/stylesheets/compass/images/flag_states/foo_active.png +0 -0
  112. data/test/fixtures/stylesheets/compass/images/flag_states/foo_focus.png +0 -0
  113. data/test/fixtures/stylesheets/compass/images/flag_states/foo_hover.png +0 -0
  114. data/test/fixtures/stylesheets/compass/images/flag_states/foo_target.png +0 -0
  115. data/test/fixtures/stylesheets/compass/sass/animation-with-legacy-ie.scss +1 -3
  116. data/test/fixtures/stylesheets/compass/sass/appearance.scss +5 -0
  117. data/test/fixtures/stylesheets/compass/sass/background-clip.scss +0 -5
  118. data/test/fixtures/stylesheets/compass/sass/background-origin.scss +0 -5
  119. data/test/fixtures/stylesheets/compass/sass/background-size.scss +0 -5
  120. data/test/fixtures/stylesheets/compass/sass/{box-sizeing.scss → box-sizing.scss} +1 -1
  121. data/test/fixtures/stylesheets/compass/sass/box_shadow.scss +2 -0
  122. data/test/fixtures/stylesheets/compass/sass/brightness.scss +12 -0
  123. data/test/fixtures/stylesheets/compass/sass/browser-support.scss +30 -0
  124. data/test/fixtures/stylesheets/compass/sass/color.scss +22 -0
  125. data/test/fixtures/stylesheets/compass/sass/filters.scss +1 -0
  126. data/test/fixtures/stylesheets/compass/sass/flexbox.scss +84 -40
  127. data/test/fixtures/stylesheets/compass/sass/gradients.sass +3 -2
  128. data/test/fixtures/stylesheets/compass/sass/selection.scss +29 -4
  129. data/test/fixtures/stylesheets/compass/sass/sprites_with_explicit_separator.scss +7 -0
  130. data/test/fixtures/stylesheets/compass/sass/support.scss +137 -0
  131. data/test/fixtures/stylesheets/compass/sass/transition.scss +0 -3
  132. data/test/fixtures/stylesheets/compass/sass/typography/links/hover-link.scss +3 -0
  133. data/test/fixtures/stylesheets/compass/sass/user-interface.scss +16 -5
  134. data/test/fixtures/stylesheets/compass/sass/utilities.scss +4 -4
  135. data/test/fixtures/stylesheets/envtest/css/env.css +4 -4
  136. data/test/fixtures/stylesheets/envtest/tmp/env.css +4 -4
  137. data/test/integrations/sprites_test.rb +30 -1
  138. data/test/test_helper.rb +2 -2
  139. data/test/units/caniuse_test.rb +115 -0
  140. data/test/units/command_line_test.rb +1 -0
  141. data/test/units/sass_extensions_test.rb +5 -0
  142. data/test/units/sprites/image_test.rb +12 -0
  143. data/test/units/sprites/sprite_map_test.rb +11 -0
  144. data/test/units/watcher/project_watcher_test.rb +26 -18
  145. metadata +96 -42
  146. data/examples/compass/src/pie.scss +0 -110
  147. data/frameworks/compass/stylesheets/compass/css3/_transform-legacy.scss +0 -87
  148. data/frameworks/compass/templates/pie/LICENSE +0 -12
  149. data/frameworks/compass/templates/pie/LICENSE-APACHE2.txt +0 -13
  150. data/frameworks/compass/templates/pie/LICENSE-GPL2.txt +0 -278
  151. data/frameworks/compass/templates/pie/PIE.htc +0 -96
  152. data/frameworks/compass/templates/pie/manifest.rb +0 -39
  153. data/frameworks/compass/templates/pie/pie.scss +0 -74
  154. data/lib/compass/sass_extensions/functions/utility.rb +0 -10
  155. data/test/fixtures/stylesheets/compass/css/pie.css +0 -23
  156. data/test/fixtures/stylesheets/compass/sass/pie.scss +0 -47
@@ -1,262 +1,5 @@
1
- @import "compass/support";
1
+ @warn "The compass/css3/shared module has been deprecated.
2
+ You can silence this warning by importing compass/css3/deprecated-support instead.
3
+ Please be aware that module will be removed in the next release.";
2
4
 
3
- // This mixin provides basic support for CSS3 properties and
4
- // their corresponding experimental CSS2 properties when
5
- // the implementations are identical except for the property
6
- // prefix.
7
- @mixin experimental($property, $value,
8
- $moz : $experimental-support-for-mozilla,
9
- $webkit : $experimental-support-for-webkit,
10
- $ms : $experimental-support-for-microsoft,
11
- $o : $experimental-support-for-opera,
12
- $khtml : $experimental-support-for-khtml,
13
- $official : true
14
- ) {
15
- @if $webkit and $experimental-support-for-webkit { -webkit-#{$property} : $value; }
16
- @if $khtml and $experimental-support-for-khtml { -khtml-#{$property} : $value; }
17
- @if $moz and $experimental-support-for-mozilla { -moz-#{$property} : $value; }
18
- @if $ms and $experimental-support-for-microsoft { -ms-#{$property} : $value; }
19
- @if $o and $experimental-support-for-opera { -o-#{$property} : $value; }
20
- @if $official { #{$property} : $value; }
21
- }
22
-
23
- // This mixin is a shortcut for applying only a single experimental value
24
- @mixin experimental-only-for($property, $value,
25
- $moz : false,
26
- $webkit : false,
27
- $ms : false,
28
- $o : false,
29
- $khtml : false,
30
- $official : false
31
- ) {
32
- @include experimental($property, $value, $moz, $webkit, $o, $ms, $khtml, $official);
33
- }
34
-
35
- // Same as experimental(), but for cases when the property is the same and the value is vendorized
36
- @mixin experimental-value($property, $value,
37
- $moz : $experimental-support-for-mozilla,
38
- $webkit : $experimental-support-for-webkit,
39
- $ms : $experimental-support-for-microsoft,
40
- $o : $experimental-support-for-opera,
41
- $khtml : $experimental-support-for-khtml,
42
- $official : true
43
- ) {
44
- @if $webkit and $experimental-support-for-webkit { #{$property} : -webkit-#{$value}; }
45
- @if $khtml and $experimental-support-for-khtml { #{$property} : -khtml-#{$value}; }
46
- @if $moz and $experimental-support-for-mozilla { #{$property} : -moz-#{$value}; }
47
- @if $ms and $experimental-support-for-microsoft { #{$property} : -ms-#{$value}; }
48
- @if $o and $experimental-support-for-opera { #{$property} : -o-#{$value}; }
49
- @if $official { #{$property} : #{$value}; }
50
- }
51
-
52
- // A debug tool for checking browser support
53
- @mixin debug-support-matrix($experimental: true, $ie: true) {
54
- @debug #{'$moz-'}$experimental-support-for-mozilla
55
- #{'$webkit-'}$experimental-support-for-webkit
56
- #{'$microsoft-'}$experimental-support-for-microsoft
57
- #{'$opera-'}$experimental-support-for-opera
58
- #{'$khtml-'}$experimental-support-for-khtml;
59
- @debug #{'$ie6-'}$legacy-support-for-ie6
60
- #{'$ie7-'}$legacy-support-for-ie7
61
- #{'$ie8-'}$legacy-support-for-ie8;
62
- }
63
-
64
- // Capture the current exerimental support settings
65
- @function capture-experimental-matrix() {
66
- @return $experimental-support-for-mozilla
67
- $experimental-support-for-webkit
68
- $experimental-support-for-microsoft
69
- $experimental-support-for-opera
70
- $experimental-support-for-khtml;
71
- }
72
-
73
- // Capture the current legacy-ie support settings
74
- @function capture-legacy-ie-matrix() {
75
- @return $legacy-support-for-ie6
76
- $legacy-support-for-ie7
77
- $legacy-support-for-ie8;
78
- }
79
-
80
- // Capture and store support
81
- $experimental-matrix: capture-experimental-matrix();
82
- $legacy-ie-matrix: capture-legacy-ie-matrix();
83
-
84
- @mixin capture-experimental-matrix {
85
- $experimental-matrix: capture-experimental-matrix();
86
- }
87
-
88
- @mixin capture-legacy-ie-matrix {
89
- $legacy-ie-matrix: capture-legacy-ie-matrix();
90
- }
91
-
92
- @mixin capture-support-matrix {
93
- @include capture-experimental-matrix;
94
- @include capture-legacy-ie-matrix;
95
- }
96
-
97
- // Change the experimental-support settings in specific contexts.
98
- @mixin set-experimental-support(
99
- $moz : false,
100
- $webkit : false,
101
- $ms : false,
102
- $o : false,
103
- $khtml : false
104
- ) {
105
- $experimental-support-for-mozilla : $moz;
106
- $experimental-support-for-webkit : $webkit;
107
- $experimental-support-for-microsoft : $ms;
108
- $experimental-support-for-opera : $o;
109
- $experimental-support-for-khtml : $khtml;
110
- }
111
-
112
- @mixin capture-and-set-experimental(
113
- $moz : false,
114
- $webkit : false,
115
- $ms : false,
116
- $o : false,
117
- $khtml : false
118
- ) {
119
- @include capture-experimental-matrix;
120
- @include set-experimental-support($moz, $webkit, $ms, $o, $khtml);
121
- }
122
-
123
- @mixin capture-and-adjust-experimental(
124
- $moz : $experimental-support-for-mozilla,
125
- $webkit : $experimental-support-for-webkit,
126
- $ms : $experimental-support-for-microsoft,
127
- $o : $experimental-support-for-opera,
128
- $khtml : $experimental-support-for-khtml
129
- ) {
130
- @include capture-experimental-matrix;
131
- @include set-experimental-support($moz, $webkit, $ms, $o, $khtml);
132
- }
133
-
134
- // Change the legacy-support-for-ie* settings in specific contexts.
135
- @mixin set-legacy-ie-support(
136
- $ie6: false,
137
- $ie7: false,
138
- $ie8: false
139
- ) {
140
- $legacy-support-for-ie6: $ie6;
141
- $legacy-support-for-ie7: $ie7;
142
- $legacy-support-for-ie8: $ie8;
143
- }
144
-
145
- @mixin capture-and-set-legacy-ie(
146
- $ie6: false,
147
- $ie7: false,
148
- $ie8: false
149
- ) {
150
- @include capture-legacy-ie-matrix;
151
- @include set-legacy-ie-support($ie6, $ie7, $ie8);
152
- }
153
-
154
- @mixin capture-and-adjust-legacy-ie(
155
- $ie6: $legacy-support-for-ie6,
156
- $ie7: $legacy-support-for-ie7,
157
- $ie8: $legacy-support-for-ie8
158
- ) {
159
- @include capture-and-set-legacy-ie($ie6, $ie7, $ie8);
160
- }
161
-
162
- // Capture current browser support matrix, and set a new matrix of support.
163
- @mixin capture-and-set-support(
164
- $moz : false,
165
- $webkit : false,
166
- $ms : false,
167
- $o : false,
168
- $khtml : false,
169
- $ie6 : false,
170
- $ie7 : false,
171
- $ie8 : false
172
- ) {
173
- // Capture the current state
174
- @include capture-support-matrix;
175
-
176
- // Change support settings
177
- @include set-experimental-support($moz, $webkit, $ms, $o, $khtml);
178
- @include set-legacy-ie-support($ie6, $ie7, $ie8);
179
- }
180
-
181
- // Capture current browser support matrix, and set a new matrix of support.
182
- @mixin capture-and-adjust-support(
183
- $moz : $experimental-support-for-mozilla,
184
- $webkit : $experimental-support-for-webkit,
185
- $ms : $experimental-support-for-microsoft,
186
- $o : $experimental-support-for-opera,
187
- $khtml : $experimental-support-for-khtml,
188
- $ie6 : $legacy-support-for-ie6,
189
- $ie7 : $legacy-support-for-ie7,
190
- $ie8 : $legacy-support-for-ie8
191
- ) {
192
- @include capture-and-set-support($moz, $webkit, $ms, $o, $khtml, $ie6, $ie7, $ie8);
193
- }
194
-
195
-
196
- // This mixin allows you to change the experimental support settings for
197
- // child (@content) styles.
198
- @mixin with-only-support-for(
199
- $moz : false,
200
- $webkit : false,
201
- $ms : false,
202
- $o : false,
203
- $khtml : false,
204
- $ie6 : false,
205
- $ie7 : false,
206
- $ie8 : false
207
- ) {
208
- // Capture current state
209
- $wo-experimental-matrix : capture-experimental-matrix();
210
- $wo-legacy-ie-matrix : capture-legacy-ie-matrix();
211
-
212
- // Set new states
213
- @include set-experimental-support($moz, $webkit, $ms, $o, $khtml);
214
- @include set-legacy-ie-support($ie6, $ie7, $ie8);
215
-
216
- // Apply styles
217
- @content;
218
-
219
- // Return to original support settings
220
- @include set-experimental-support($wo-experimental-matrix...);
221
- @include set-legacy-ie-support($wo-legacy-ie-matrix...);
222
- }
223
-
224
- // This mixin is a shortcut for making slight adjustments to browser support
225
- // for child (@content) styles
226
- @mixin adjust-support-for(
227
- $moz : $experimental-support-for-mozilla,
228
- $webkit : $experimental-support-for-webkit,
229
- $ms : $experimental-support-for-microsoft,
230
- $o : $experimental-support-for-opera,
231
- $khtml : $experimental-support-for-khtml,
232
- $ie6 : $legacy-support-for-ie6,
233
- $ie7 : $legacy-support-for-ie7,
234
- $ie8 : $legacy-support-for-ie8
235
- ) {
236
- @include with-only-support-for($moz, $webkit, $ms, $o, $khtml, $ie6, $ie7, $ie8) {
237
- @content;
238
- }
239
- }
240
-
241
- // Set a default value if the given arglist is empty
242
- @function set-arglist-default(
243
- $arglist,
244
- $default
245
- ) {
246
- $default: if(length($default) > 0, $default, null);
247
- $output: compact();
248
- @each $layer in $arglist {
249
- $output: append($output, if($layer == 'default', $default, $layer));
250
- }
251
- @return if(length($output) > 0, $output, $default);
252
- }
253
-
254
- // @private Returns the legacy value for a given box-model
255
- // - Used by background-clip and -origin.
256
- @function legacy-box($box) {
257
- $box: unquote($box);
258
- @if $box == padding-box { $box: padding; }
259
- @if $box == border-box { $box: border; }
260
- @if $box == content-box { $box: content; }
261
- @return $box;
262
- }
5
+ @import "deprecated-support";
@@ -1,6 +1,6 @@
1
1
  // Text Shadow
2
2
 
3
- @import "shared";
3
+ @import "compass/support";
4
4
 
5
5
 
6
6
  // These defaults make the arguments optional for this mixin
@@ -1,4 +1,7 @@
1
- @import "shared";
1
+ @import "compass/support";
2
+
3
+ // The the user threshold for transform support. Defaults to `$graceful-usage-threshold`
4
+ $transform-support-threshold: $graceful-usage-threshold;
2
5
 
3
6
  // @doc off
4
7
  // Note ----------------------------------------------------------------------
@@ -101,16 +104,10 @@ $default-skew-y : 5deg !default;
101
104
  // @param only3d Set this to true to only apply this
102
105
  // mixin where browsers have 3D support.
103
106
  @mixin apply-origin($origin, $only3d) {
104
- $only3d: $only3d or -compass-list-size(-compass-list($origin)) > 2;
105
- @if $only3d {
106
- @include experimental(transform-origin, $origin,
107
- -moz, -webkit, -ms, -o, not -khtml, official
108
- );
109
- } @else {
110
- @include experimental(transform-origin, $origin,
111
- -moz, -webkit, -ms, -o, not -khtml, official
112
- );
113
- }
107
+ $capability: if($only3d or length($origin) > 2, transforms3d, transforms2d);
108
+ @include prefixed-properties($capability, $transform-support-threshold, (
109
+ transform-origin: $origin
110
+ ));
114
111
  }
115
112
 
116
113
  // Transform-origin sent as individual arguments:
@@ -145,15 +142,10 @@ $default-skew-y : 5deg !default;
145
142
  $transform,
146
143
  $only3d: false
147
144
  ) {
148
- @if $only3d {
149
- @include experimental(transform, $transform,
150
- -moz, -webkit, -ms, -o, not -khtml, official
151
- );
152
- } @else {
153
- @include experimental(transform, $transform,
154
- -moz, -webkit, -ms, -o, not -khtml, official
155
- );
156
- }
145
+ $capability: if($only3d, transforms3d, transforms2d);
146
+ @include prefixed-properties($capability, $transform-support-threshold, (
147
+ transform: $transform
148
+ ));
157
149
  }
158
150
 
159
151
  // Shortcut to target all browsers with 2D transform support
@@ -178,9 +170,9 @@ $default-skew-y : 5deg !default;
178
170
  // z-axis. The higher the perspective, the more exaggerated the foreshortening.
179
171
  // values from 500 to 1000 are more-or-less "normal" - a good starting-point.
180
172
  @mixin perspective($p) {
181
- @include experimental(perspective, $p,
182
- -moz, -webkit, -ms, -o, not -khtml, official
183
- );
173
+ @include prefixed-properties(transforms3d, $transform-support-threshold, (
174
+ perspective: $p
175
+ ));
184
176
  }
185
177
 
186
178
  // Set the origin position for the perspective
@@ -189,9 +181,9 @@ $default-skew-y : 5deg !default;
189
181
  //
190
182
  // where the two arguments represent x/y coordinates
191
183
  @mixin perspective-origin($origin: 50%) {
192
- @include experimental(perspective-origin, $origin,
193
- -moz, -webkit, -ms, -o, not -khtml, official
194
- );
184
+ @include prefixed-properties(transforms3d, $transform-support-threshold, (
185
+ perspective-origin: $origin
186
+ ));
195
187
  }
196
188
 
197
189
  // Determine whether a 3D objects children also live in the given 3D space
@@ -201,9 +193,9 @@ $default-skew-y : 5deg !default;
201
193
  // where `style` can be either `flat` or `preserve-3d`.
202
194
  // Browsers default to `flat`, mixin defaults to `preserve-3d`.
203
195
  @mixin transform-style($style: preserve-3d) {
204
- @include experimental(transform-style, $style,
205
- -moz, -webkit, -ms, -o, not -khtml, official
206
- );
196
+ @include prefixed-properties(transforms3d, $transform-support-threshold, (
197
+ transform-style: $style
198
+ ));
207
199
  }
208
200
 
209
201
  // Determine the visibility of an element when it's back is turned
@@ -213,9 +205,9 @@ $default-skew-y : 5deg !default;
213
205
  // where `visibility` can be either `visible` or `hidden`.
214
206
  // Browsers default to visible, mixin defaults to hidden
215
207
  @mixin backface-visibility($visibility: hidden) {
216
- @include experimental(backface-visibility, $visibility,
217
- -moz, -webkit, -ms, -o, not -khtml, official
218
- );
208
+ @include prefixed-properties(transforms3d, $transform-support-threshold, (
209
+ backface-visibility: $visibility
210
+ ));
219
211
  }
220
212
 
221
213
  // @doc off
@@ -1,4 +1,8 @@
1
- @import "shared";
1
+ @import "compass/support";
2
+
3
+ // The the user threshold for transition support. Defaults to `$graceful-usage-threshold`
4
+ $transition-support-threshold: $graceful-usage-threshold !default;
5
+
2
6
 
3
7
  // CSS Transitions
4
8
  // Currently only works in Webkit.
@@ -19,34 +23,50 @@ $default-transition-property: all !default;
19
23
 
20
24
  $default-transition-duration: 1s !default;
21
25
 
22
- $default-transition-function: false !default;
26
+ $default-transition-function: null !default;
23
27
 
24
- $default-transition-delay: false !default;
28
+ $default-transition-delay: null !default;
25
29
 
26
30
  $transitionable-prefixed-values: transform, transform-origin !default;
27
31
 
32
+
33
+
34
+ // Checks if the value given is a unit of time.
35
+ @function is-time($value) {
36
+ @return if(type-of($value) == number, not not index(s ms, unit($value)), false);
37
+ }
38
+
39
+ // Returns `$property` with the given prefix if it is found in `$transitionable-prefixed-values`.
40
+ @function prefixed-for-transition($prefix, $property) {
41
+ @if not $prefix {
42
+ @return $property;
43
+ }
44
+ @if type-of($property) == list or type-of($property) == arglist {
45
+ $new-list: comma-list();
46
+ @each $v in $property {
47
+ $new-list: append($new-list, prefixed-for-transition($prefix, $v));
48
+ }
49
+ @return $new-list;
50
+ } @else {
51
+ @if index($transitionable-prefixed-values, $property) {
52
+ @return #{$prefix}-#{$property};
53
+ } @else {
54
+ @return $property;
55
+ }
56
+ }
57
+ }
58
+
28
59
  // One or more properties to transition
29
60
  //
30
61
  // * for multiple, use a comma-delimited list
31
62
  // * also accepts "all" or "none"
32
63
 
33
- @mixin transition-property($property-1: $default-transition-property,
34
- $property-2 : false,
35
- $property-3 : false,
36
- $property-4 : false,
37
- $property-5 : false,
38
- $property-6 : false,
39
- $property-7 : false,
40
- $property-8 : false,
41
- $property-9 : false,
42
- $property-10: false
43
- ) {
44
- @if type-of($property-1) == string { $property-1: unquote($property-1); }
45
- $properties: compact($property-1, $property-2, $property-3, $property-4, $property-5, $property-6, $property-7, $property-8, $property-9, $property-10);
46
- @if $experimental-support-for-webkit { -webkit-transition-property : prefixed-for-transition(-webkit, $properties); }
47
- @if $experimental-support-for-mozilla { -moz-transition-property : prefixed-for-transition(-moz, $properties); }
48
- @if $experimental-support-for-opera { -o-transition-property : prefixed-for-transition(-o, $properties); }
49
- transition-property : $properties;
64
+ @mixin transition-property($properties...) {
65
+ $properties: set-arglist-default($properties, $default-transition-property);
66
+ @include with-each-prefix(css-transitions, $transition-support-threshold) {
67
+ $props: if($current-prefix, prefixed-for-transition($current-prefix, $properties), $properties);
68
+ @include prefix-prop(transition-property, $props);
69
+ }
50
70
  }
51
71
 
52
72
  // One or more durations in seconds
@@ -54,22 +74,11 @@ $transitionable-prefixed-values: transform, transform-origin !default;
54
74
  // * for multiple, use a comma-delimited list
55
75
  // * these durations will affect the properties in the same list position
56
76
 
57
- @mixin transition-duration($duration-1: $default-transition-duration,
58
- $duration-2 : false,
59
- $duration-3 : false,
60
- $duration-4 : false,
61
- $duration-5 : false,
62
- $duration-6 : false,
63
- $duration-7 : false,
64
- $duration-8 : false,
65
- $duration-9 : false,
66
- $duration-10: false
67
- ) {
68
- @if type-of($duration-1) == string { $duration-1: unquote($duration-1); }
69
- $durations: compact($duration-1, $duration-2, $duration-3, $duration-4, $duration-5, $duration-6, $duration-7, $duration-8, $duration-9, $duration-10);
70
- @include experimental(transition-duration, $durations,
71
- -moz, -webkit, not -ms, -o, not -khtml, official
72
- );
77
+ @mixin transition-duration($durations...) {
78
+ $durations: set-arglist-default($durations, $default-transition-duration);
79
+ @include prefixed-properties(css-transitions, $transition-support-threshold, (
80
+ transition-duration: $durations
81
+ ));
73
82
  }
74
83
 
75
84
  // One or more timing functions
@@ -78,22 +87,11 @@ $transitionable-prefixed-values: transform, transform-origin !default;
78
87
  // * For multiple, use a comma-delimited list
79
88
  // * These functions will effect the properties in the same list position
80
89
 
81
- @mixin transition-timing-function($function-1: $default-transition-function,
82
- $function-2 : false,
83
- $function-3 : false,
84
- $function-4 : false,
85
- $function-5 : false,
86
- $function-6 : false,
87
- $function-7 : false,
88
- $function-8 : false,
89
- $function-9 : false,
90
- $function-10: false
91
- ) {
92
- $function-1: unquote($function-1);
93
- $functions: compact($function-1, $function-2, $function-3, $function-4, $function-5, $function-6, $function-7, $function-8, $function-9, $function-10);
94
- @include experimental(transition-timing-function, $functions,
95
- -moz, -webkit, not -ms, -o, not -khtml, official
96
- );
90
+ @mixin transition-timing-function($functions...) {
91
+ $functions: set-arglist-default($functions, $default-transition-function);
92
+ @include prefixed-properties(css-transitions, $transition-support-threshold, (
93
+ transition-timing-function: $functions
94
+ ));
97
95
  }
98
96
 
99
97
  // One or more transition-delays in seconds
@@ -101,22 +99,11 @@ $transitionable-prefixed-values: transform, transform-origin !default;
101
99
  // * for multiple, use a comma-delimited list
102
100
  // * these delays will effect the properties in the same list position
103
101
 
104
- @mixin transition-delay($delay-1: $default-transition-delay,
105
- $delay-2 : false,
106
- $delay-3 : false,
107
- $delay-4 : false,
108
- $delay-5 : false,
109
- $delay-6 : false,
110
- $delay-7 : false,
111
- $delay-8 : false,
112
- $delay-9 : false,
113
- $delay-10: false
114
- ) {
115
- @if type-of($delay-1) == string { $delay-1: unquote($delay-1); }
116
- $delays: compact($delay-1, $delay-2, $delay-3, $delay-4, $delay-5, $delay-6, $delay-7, $delay-8, $delay-9, $delay-10);
117
- @include experimental(transition-delay, $delays,
118
- -moz, -webkit, not -ms, -o, not -khtml, official
119
- );
102
+ @mixin transition-delay($delays...) {
103
+ $delays: set-arglist-default($delays, $default-transition-delay);
104
+ @include prefixed-properties(css-transitions, $transition-support-threshold, (
105
+ transition-delay: $delays
106
+ ));
120
107
  }
121
108
 
122
109
  // Transition all-in-one shorthand
@@ -130,92 +117,55 @@ $transitionable-prefixed-values: transform, transform-origin !default;
130
117
  @include transition(compact($property $duration $function $delay));
131
118
  }
132
119
 
133
- @mixin transition(
134
- $transition-1 : default,
135
- $transition-2 : false,
136
- $transition-3 : false,
137
- $transition-4 : false,
138
- $transition-5 : false,
139
- $transition-6 : false,
140
- $transition-7 : false,
141
- $transition-8 : false,
142
- $transition-9 : false,
143
- $transition-10: false
144
- ) {
145
- @if $transition-1 == default {
146
- $transition-1 : compact($default-transition-property $default-transition-duration $default-transition-function $default-transition-delay);
147
- }
148
- $transitions: false;
149
- @if type-of($transition-1) == list and type-of(nth($transition-1,1)) == list {
150
- $transitions: join($transition-1, compact($transition-2, $transition-3, $transition-4, $transition-5, $transition-6, $transition-7, $transition-8, $transition-9, $transition-10), comma);
151
- } @else {
152
- $transitions : compact($transition-1, $transition-2, $transition-3, $transition-4, $transition-5, $transition-6, $transition-7, $transition-8, $transition-9, $transition-10);
153
- }
154
- $delays: comma-list();
155
- $has-delays: false;
156
- $webkit-value: comma-list();
157
- $moz-value: comma-list();
158
- $o-value: comma-list();
159
-
160
- // This block can be made considerably simpler at the point in time that
161
- // we no longer need to deal with the differences in how delays are treated.
162
- @each $transition in $transitions {
163
- // Extract the values from the list
164
- // (this would be cleaner if nth took a 3rd argument to provide a default value).
165
- $property: nth($transition, 1);
166
- $duration: false;
167
- $timing-function: false;
168
- $delay: false;
169
- @if length($transition) > 1 { $duration: nth($transition, 2); }
170
- @if length($transition) > 2 { $timing-function: nth($transition, 3); }
171
- @if length($transition) > 3 { $delay: nth($transition, 4); $has-delays: true; }
172
-
173
- // If a delay is provided without a timing function
174
- @if is-time($timing-function) and not $delay { $delay: $timing-function; $timing-function: false; $has-delays: true; }
175
-
176
- // Keep a list of delays in case one is specified
177
- $delays: append($delays, if($delay, $delay, 0s));
178
-
179
- $webkit-value: append($webkit-value, compact(prefixed-for-transition(-webkit, $property) $duration $timing-function));
180
- $moz-value: append( $moz-value, compact(prefixed-for-transition( -moz, $property) $duration $timing-function $delay));
181
- $o-value: append( $o-value, compact(prefixed-for-transition( -o, $property) $duration $timing-function $delay));
182
- }
183
-
184
- @if $experimental-support-for-webkit { -webkit-transition : $webkit-value;
185
- // old webkit doesn't support the delay parameter in the shorthand so we progressively enhance it.
186
- @if $has-delays { -webkit-transition-delay : $delays; } }
187
- @if $experimental-support-for-mozilla { -moz-transition : $moz-value; }
188
- @if $experimental-support-for-opera { -o-transition : $o-value; }
189
- transition : $transitions;
190
- }
191
-
192
- // coerce a list to be comma delimited or make a new, empty comma delimited list.
193
- @function comma-list($list: ()) {
194
- @return join((), $list, comma);
195
- }
196
-
197
- // Returns `$property` with the given prefix if it is found in `$transitionable-prefixed-values`.
198
- @function prefixed-for-transition($prefix, $property) {
199
- @if type-of($property) == list {
200
- $new-list: comma-list();
201
- @each $v in $property {
202
- $new-list: append($new-list, prefixed-for-transition($prefix, $v));
120
+ @mixin transition($transitions...) {
121
+ $default: compact($default-transition-property $default-transition-duration $default-transition-function $default-transition-delay);
122
+ $transitions: set-arglist-default($transitions, $default);
123
+
124
+ @include with-each-prefix(css-transitions, $transition-support-threshold) {
125
+ $delays: ();
126
+ $transitions-without-delays: ();
127
+ $transitions-with-delays: ();
128
+ $has-delays: false;
129
+
130
+
131
+ // This block can be made considerably simpler at the point in time that
132
+ // we no longer need to deal with the differences in how delays are treated.
133
+ @each $transition in $transitions {
134
+ // Extract the values from the list
135
+ // (this would be cleaner if nth took a 3rd argument to provide a default value).
136
+ $property: nth($transition, 1);
137
+ $duration: if(length($transition) >= 2, nth($transition, 2), null);
138
+ $timing-function: if(length($transition) >= 3, nth($transition, 3), null);
139
+ $delay: if(length($transition) >= 4, nth($transition, 4), null);
140
+ $has-delays: $has-delays or $delay;
141
+
142
+ // If a delay is provided without a timing function
143
+ @if is-time($timing-function) and not $delay {
144
+ $delay: $timing-function;
145
+ $timing-function: null;
146
+ $has-delays: true;
147
+ }
148
+
149
+ @if $current-prefix == -webkit {
150
+ // Keep a list of delays in case one is specified
151
+ $delays: append($delays, if($delay, $delay, 0s));
152
+ $transitions-without-delays: append($transitions-without-delays,
153
+ prefixed-for-transition($current-prefix, $property) $duration $timing-function);
154
+ } @else {
155
+ $transitions-with-delays: append($transitions-with-delays,
156
+ prefixed-for-transition($current-prefix, $property) $duration $timing-function $delay);
157
+ }
203
158
  }
204
- @return $new-list;
205
- } @else {
206
- @if index($transitionable-prefixed-values, $property) {
207
- @return #{$prefix}-#{$property};
159
+
160
+ @if $current-prefix == -webkit {
161
+ @include prefix-prop(transition, $transitions-without-delays);
162
+ @if $has-delays {
163
+ @include prefix-prop(transition-delay, $delays);
164
+ }
165
+ } @else if $current-prefix {
166
+ @include prefix-prop(transition, $transitions-with-delays);
208
167
  } @else {
209
- @return $property;
168
+ transition: $transitions-with-delays;
210
169
  }
211
170
  }
212
171
  }
213
-
214
- // Checks if the value given is a unit of time.
215
- @function is-time($value) {
216
- @if type-of($value) == number {
217
- @return not not index(s ms, unit($value));
218
- } @else {
219
- @return false;
220
- }
221
- }