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

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
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,17 +1,15 @@
1
1
  // Box Sizing
2
2
 
3
- @import "shared";
4
-
5
- // @private css3-feature-support variables must always include a list of five boolean values
6
- // representing in order: -moz, -webkit, -ms, -o, -khtml
7
- $box-sizing-support: -moz, -webkit, not -ms, not -o, not -khtml;
3
+ @import "compass/support";
8
4
 
5
+ // The prefixed support threshold for box-sizing.
6
+ // Defaults to the $graceful-usage-threshold.
7
+ $box-sizing-support-threshold: $critical-usage-threshold !default;
9
8
 
10
9
  // Change the box model for Mozilla, Webkit, IE8 and the future
11
10
  //
12
- // @param $box-model
13
- // [ content-box | border-box | padding-box ]
11
+ // $box-model: [ content-box | border-box | padding-box ]
14
12
  @mixin box-sizing($box-model) {
15
13
  $box-model: unquote($box-model);
16
- @include experimental(box-sizing, $box-model, $box-sizing-support...);
14
+ @include prefixed-properties(css3-boxsizing, $box-sizing-support-threshold, (box-sizing: $box-model));
17
15
  }
@@ -1,11 +1,10 @@
1
1
  // Flexible Box
2
+ @import "deprecated-support";
2
3
 
3
- @import "shared";
4
+ @warn "The compass/css3/box module is DEPRECATED and will be removed in the next release. Please use compass/css3/flexbox instead.";
4
5
 
5
6
  // @private css3-feature-support variables must always include a list of five boolean values
6
- // representing in order: -moz, -webkit, -ms, -o, -khtml
7
- $flexbox-support: -moz, -webkit, -ms, not -o, not -khtml;
8
-
7
+ $legacy-box-support: -moz, -webkit, not -o, -ms, not -khtml;
9
8
 
10
9
  // Default box orientation, assuming that the user wants something less block-like
11
10
  $default-box-orient : horizontal !default;
@@ -35,52 +34,52 @@ $default-box-pack : start !default;
35
34
  // Apply 'display:box;' to an element.
36
35
  // - must be used for any of the other flexbox mixins to work properly
37
36
  @mixin display-box {
38
- @include experimental-value(display, box, $flexbox-support...);
37
+ @include experimental-value(display, box, $legacy-box-support...);
39
38
  }
40
39
 
41
40
  // Box orientation [ horizontal | vertical | inline-axis | block-axis | inherit ]
42
41
  @mixin box-orient($orientation: $default-box-orient) {
43
42
  $orientation : unquote($orientation);
44
- @include experimental(box-orient, $orientation, $flexbox-support...);
43
+ @include experimental(box-orient, $orientation, $legacy-box-support...);
45
44
  }
46
45
 
47
46
  // Box align [ start | end | center | baseline | stretch ]
48
47
  @mixin box-align($alignment: $default-box-align) {
49
48
  $alignment : unquote($alignment);
50
- @include experimental(box-align, $alignment, $flexbox-support...);
49
+ @include experimental(box-align, $alignment, $legacy-box-support...);
51
50
  }
52
51
 
53
52
  // Takes an int argument for box flex. Apply this to the children inside the box.
54
53
  //
55
54
  // For example: "div.display-box > div.child-box" would get the box flex mixin.
56
55
  @mixin box-flex($flex: $default-box-flex) {
57
- @include experimental(box-flex, $flex, $flexbox-support...);
56
+ @include experimental(box-flex, $flex, $legacy-box-support...);
58
57
  }
59
58
 
60
59
  // Takes an int argument for flexible grouping
61
60
  @mixin box-flex-group($group: $default-box-flex-group) {
62
- @include experimental(box-flex-group, $group, $flexbox-support...);
61
+ @include experimental(box-flex-group, $group, $legacy-box-support...);
63
62
  }
64
63
 
65
64
  // Takes an int argument for ordinal grouping and rearranging the order
66
65
  @mixin box-ordinal-group($group: $default-box-ordinal-group) {
67
- @include experimental(box-ordinal-group, $group, $flexbox-support...);
66
+ @include experimental(box-ordinal-group, $group, $legacy-box-support...);
68
67
  }
69
68
 
70
69
  // Box direction [ normal | reverse | inherit ]
71
70
  @mixin box-direction($direction: $default-box-direction) {
72
71
  $direction: unquote($direction);
73
- @include experimental(box-direction, $direction, $flexbox-support...);
72
+ @include experimental(box-direction, $direction, $legacy-box-support...);
74
73
  }
75
74
 
76
75
  // Box lines [ single | multiple ]
77
76
  @mixin box-lines($lines: $default-box-lines) {
78
77
  $lines: unquote($lines);
79
- @include experimental(box-lines, $lines, $flexbox-support...);
78
+ @include experimental(box-lines, $lines, $legacy-box-support...);
80
79
  }
81
80
 
82
81
  // Box pack [ start | end | center | justify ]
83
82
  @mixin box-pack($pack: $default-box-pack) {
84
83
  $pack: unquote($pack);
85
- @include experimental(box-pack, $pack, $flexbox-support...);
84
+ @include experimental(box-pack, $pack, $legacy-box-support...);
86
85
  }
@@ -1,10 +1,9 @@
1
1
  // Columns
2
+ @import "compass/support";
2
3
 
3
- @import "shared";
4
-
5
- // @private css3-feature-support variables must always include a list of five boolean values
6
- // representing in order: -moz, -webkit, -ms, -o, -khtml
7
- $multicolumn-support: -moz, -webkit, not -ms, not -o, not -khtml;
4
+ // The prefixed support threshold for columns.
5
+ // Defaults to the $critical-usage-threshold.
6
+ $multicolumn-support-threshold: $critical-usage-threshold !default;
8
7
 
9
8
 
10
9
  // Specify the shorthand `columns` property.
@@ -13,48 +12,62 @@ $multicolumn-support: -moz, -webkit, not -ms, not -o, not -khtml;
13
12
  //
14
13
  // @include columns(20em 2);
15
14
  @mixin columns($width-and-count) {
16
- @include experimental(columns, $width-and-count, $multicolumn-support...);
15
+ @include prefixed-properties(multicolumn, $multicolumn-support-threshold,(
16
+ columns: $width-and-count
17
+ ));
17
18
  }
18
19
 
19
20
  // Specify the number of columns
20
21
  @mixin column-count($count) {
21
- @include experimental(column-count, $count, $multicolumn-support...);
22
+ @include prefixed-properties(multicolumn, $multicolumn-support-threshold,(
23
+ column-count: $count
24
+ ));
22
25
  }
23
26
 
24
27
  // Specify the gap between columns e.g. `20px`
25
28
  @mixin column-gap($width) {
26
- @include experimental(column-gap, $width, $multicolumn-support...);
29
+ @include prefixed-properties(multicolumn, $multicolumn-support-threshold,(
30
+ column-gap: $width
31
+ ));
27
32
  }
28
33
 
29
34
  // Specify the width of columns e.g. `100px`
30
35
  @mixin column-width($width) {
31
- @include experimental(column-width, $width, $multicolumn-support...);
36
+ @include prefixed-properties(multicolumn, $multicolumn-support-threshold,(
37
+ column-width: $width
38
+ ));
32
39
  }
33
40
 
34
41
  // Specify how many columns an element should span across.
35
42
  //
36
43
  // * legal values are 1, all
37
44
  @mixin column-span($columns) {
38
- @include experimental(column-span, $columns,
39
- -moz, -webkit, -o, -ms, not -khtml, official
40
- );
45
+ @include prefixed-properties(multicolumn, $multicolumn-support-threshold,(
46
+ column-span: $columns
47
+ ));
41
48
  }
42
49
 
43
50
  // Specify the width of the rule between columns e.g. `1px`
44
51
  @mixin column-rule-width($width) {
45
- @include experimental(rule-width, $width, $multicolumn-support...);
52
+ @include prefixed-properties(multicolumn, $multicolumn-support-threshold,(
53
+ rule-width: $width
54
+ ));
46
55
  }
47
56
 
48
57
  // Specify the style of the rule between columns e.g. `dotted`.
49
58
  // This works like border-style.
50
59
  @mixin column-rule-style($style) {
51
- @include experimental(rule-style, unquote($style), $multicolumn-support...);
60
+ @include prefixed-properties(multicolumn, $multicolumn-support-threshold,(
61
+ rule-style: $style
62
+ ));
52
63
  }
53
64
 
54
65
  // Specify the color of the rule between columns e.g. `blue`.
55
66
  // This works like border-color.
56
67
  @mixin column-rule-color($color) {
57
- @include experimental(rule-color, $color, $multicolumn-support...);
68
+ @include prefixed-properties(multicolumn, $multicolumn-support-threshold,(
69
+ rule-color: $color
70
+ ));
58
71
  }
59
72
 
60
73
  // Mixin encompassing all column rule properties
@@ -65,9 +78,10 @@ $multicolumn-support: -moz, -webkit, not -ms, not -o, not -khtml;
65
78
  // Or the values can be space separated:
66
79
  //
67
80
  // @include column-rule(1px solid #c00)
68
- @mixin column-rule($width, $style: false, $color: false) {
69
- $full : -compass-space-list(compact($width, $style, $color));
70
- @include experimental(column-rule, $full, $multicolumn-support...);
81
+ @mixin column-rule($width, $style: null, $color: null) {
82
+ @include prefixed-properties(multicolumn, $multicolumn-support-threshold,(
83
+ column-rule: $width $style $color
84
+ ));
71
85
  }
72
86
 
73
87
  // All-purpose mixin for setting column breaks.
@@ -97,13 +111,15 @@ $multicolumn-support: -moz, -webkit, not -ms, not -o, not -khtml;
97
111
  // break-inside: auto;}
98
112
 
99
113
  @mixin column-break($type: before, $value: auto){
100
- // Webkit uses non-standard syntax
101
- @if $experimental-support-for-webkit {
102
- -webkit-column-break-#{$type}: $value;
114
+ @include with-each-prefix(multicolumn, $multicolumn-support-threshold) {
115
+ @if $current-prefix == -webkit {
116
+ // Webkit uses non-standard syntax
117
+ -webkit-column-break-#{$type}: $value;
118
+ } @else {
119
+ // Official syntax
120
+ break-#{$type}: $value;
121
+ }
103
122
  }
104
-
105
- // Official syntax
106
- break-#{$type}: $value;
107
123
  }
108
124
 
109
125
  // Mixin for setting break-before
@@ -176,7 +192,9 @@ $multicolumn-support: -moz, -webkit, not -ms, not -o, not -khtml;
176
192
  // Example:
177
193
  // h2.span {@include column-span();}
178
194
  @mixin column-span($span: all){
179
- @include experimental(column-span, unquote($span), $multicolumn-support...);
195
+ @include prefixed-properties(multicolumn, $multicolumn-support-threshold,(
196
+ column-span: $span
197
+ ));
180
198
  }
181
199
 
182
200
  // Mixin for setting column-fill
@@ -186,5 +204,7 @@ $multicolumn-support: -moz, -webkit, not -ms, not -o, not -khtml;
186
204
  // Example:
187
205
  // h2.fill {@include column-fill();}
188
206
  @mixin column-fill($fill: balance){
189
- @include experimental(column-fill, unquote($fill), $multicolumn-support...);
207
+ @include prefixed-properties(multicolumn, $multicolumn-support-threshold,(
208
+ column-fill: $fill
209
+ ));
190
210
  }
@@ -0,0 +1,272 @@
1
+ @import "compass/support";
2
+
3
+ // XXX Remove these
4
+ $experimental-support-for-mozilla: true !default;
5
+ $experimental-support-for-webkit: true !default;
6
+ $experimental-support-for-opera: true !default;
7
+ $experimental-support-for-microsoft: true !default;
8
+ $experimental-support-for-khtml: false !default;
9
+ $experimental-support-for-svg: false !default;
10
+ $legacy-support-for-ie6: true !default;
11
+ $legacy-support-for-ie7: true !default;
12
+ $legacy-support-for-ie8: true !default;
13
+ $legacy-support-for-mozilla: true !default;
14
+ $legacy-support-for-webkit: true !default;
15
+
16
+ // This mixin provides basic support for CSS3 properties and
17
+ // their corresponding experimental CSS2 properties when
18
+ // the implementations are identical except for the property
19
+ // prefix.
20
+ @mixin experimental($property, $value,
21
+ $moz : $experimental-support-for-mozilla,
22
+ $webkit : $experimental-support-for-webkit,
23
+ $o : $experimental-support-for-opera,
24
+ $ms : $experimental-support-for-microsoft,
25
+ $khtml : $experimental-support-for-khtml,
26
+ $official : true
27
+ ) {
28
+ @if $webkit and $experimental-support-for-webkit { -webkit-#{$property} : $value; }
29
+ @if $khtml and $experimental-support-for-khtml { -khtml-#{$property} : $value; }
30
+ @if $moz and $experimental-support-for-mozilla { -moz-#{$property} : $value; }
31
+ @if $ms and $experimental-support-for-microsoft { -ms-#{$property} : $value; }
32
+ @if $o and $experimental-support-for-opera { -o-#{$property} : $value; }
33
+ @if $official { #{$property} : $value; }
34
+ }
35
+
36
+ // This mixin is a shortcut for applying only a single experimental value
37
+ @mixin experimental-only-for($property, $value,
38
+ $moz : false,
39
+ $webkit : false,
40
+ $o : false,
41
+ $ms : false,
42
+ $khtml : false,
43
+ $official : false
44
+ ) {
45
+ @include experimental($property, $value, $moz, $webkit, $o, $ms, $khtml, $official);
46
+ }
47
+
48
+ // Same as experimental(), but for cases when the property is the same and the value is vendorized
49
+ @mixin experimental-value($property, $value,
50
+ $moz : $experimental-support-for-mozilla,
51
+ $webkit : $experimental-support-for-webkit,
52
+ $o : $experimental-support-for-opera,
53
+ $ms : $experimental-support-for-microsoft,
54
+ $khtml : $experimental-support-for-khtml,
55
+ $official : true
56
+ ) {
57
+ @if $webkit and $experimental-support-for-webkit { #{$property} : -webkit-#{$value}; }
58
+ @if $khtml and $experimental-support-for-khtml { #{$property} : -khtml-#{$value}; }
59
+ @if $moz and $experimental-support-for-mozilla { #{$property} : -moz-#{$value}; }
60
+ @if $ms and $experimental-support-for-microsoft { #{$property} : -ms-#{$value}; }
61
+ @if $o and $experimental-support-for-opera { #{$property} : -o-#{$value}; }
62
+ @if $official { #{$property} : #{$value}; }
63
+ }
64
+
65
+ // @private
66
+ // Check a given support list for support of a particular browser
67
+ @function supported(
68
+ $prefix,
69
+ $support-list
70
+ ) {
71
+ $keys: moz, webkit, o, ms, khtml, official;
72
+ $index: index($keys, $prefix);
73
+
74
+ @if $index {
75
+ @if $index == 6 and length($support-list) == 5 {
76
+ @return official;
77
+ } @else {
78
+ @return nth($support-list, $index);
79
+ }
80
+ } @else {
81
+ @warn 'Please pass a valid browser for $prefix: moz, webkit, o, ms, khtml, or official.';
82
+ }
83
+ }
84
+
85
+ // A debug tool for checking browser support
86
+ @mixin debug-support-matrix($experimental: true, $ie: true) {
87
+ @debug #{'$moz-'}$experimental-support-for-mozilla
88
+ #{'$webkit-'}$experimental-support-for-webkit
89
+ #{'$opera-'}$experimental-support-for-opera
90
+ #{'$microsoft-'}$experimental-support-for-microsoft
91
+ #{'$khtml-'}$experimental-support-for-khtml;
92
+ @debug #{'$ie6-'}$legacy-support-for-ie6
93
+ #{'$ie7-'}$legacy-support-for-ie7
94
+ #{'$ie8-'}$legacy-support-for-ie8;
95
+ }
96
+
97
+ // Capture the current exerimental support settings
98
+ @function capture-experimental-matrix() {
99
+ @return $experimental-support-for-mozilla
100
+ $experimental-support-for-webkit
101
+ $experimental-support-for-opera
102
+ $experimental-support-for-microsoft
103
+ $experimental-support-for-khtml;
104
+ }
105
+
106
+ // Capture the current legacy-ie support settings
107
+ @function capture-legacy-ie-matrix() {
108
+ @return $legacy-support-for-ie6
109
+ $legacy-support-for-ie7
110
+ $legacy-support-for-ie8;
111
+ }
112
+
113
+ // Capture and store support
114
+ $experimental-matrix: capture-experimental-matrix();
115
+ $legacy-ie-matrix: capture-legacy-ie-matrix();
116
+
117
+ @mixin capture-experimental-matrix {
118
+ $experimental-matrix: capture-experimental-matrix();
119
+ }
120
+
121
+ @mixin capture-legacy-ie-matrix {
122
+ $legacy-ie-matrix: capture-legacy-ie-matrix();
123
+ }
124
+
125
+ @mixin capture-support-matrix {
126
+ @include capture-experimental-matrix;
127
+ @include capture-legacy-ie-matrix;
128
+ }
129
+
130
+ // Change the experimental-support settings in specific contexts.
131
+ @mixin set-experimental-support(
132
+ $moz : false,
133
+ $webkit : false,
134
+ $o : false,
135
+ $ms : false,
136
+ $khtml : false
137
+ ) {
138
+ $experimental-support-for-mozilla : $moz;
139
+ $experimental-support-for-webkit : $webkit;
140
+ $experimental-support-for-opera : $o;
141
+ $experimental-support-for-microsoft : $ms;
142
+ $experimental-support-for-khtml : $khtml;
143
+ }
144
+
145
+ @mixin capture-and-set-experimental(
146
+ $moz : false,
147
+ $webkit : false,
148
+ $o : false,
149
+ $ms : false,
150
+ $khtml : false
151
+ ) {
152
+ @include capture-experimental-matrix;
153
+ @include set-experimental-support($moz, $webkit, $o, $ms, $khtml);
154
+ }
155
+
156
+ @mixin capture-and-adjust-experimental(
157
+ $moz : $experimental-support-for-mozilla,
158
+ $webkit : $experimental-support-for-webkit,
159
+ $o : $experimental-support-for-opera,
160
+ $ms : $experimental-support-for-microsoft,
161
+ $khtml : $experimental-support-for-khtml
162
+ ) {
163
+ @include capture-experimental-matrix;
164
+ @include set-experimental-support($moz, $webkit, $o, $ms, $khtml);
165
+ }
166
+
167
+ // Change the legacy-support-for-ie* settings in specific contexts.
168
+ @mixin set-legacy-ie-support(
169
+ $ie6: false,
170
+ $ie7: false,
171
+ $ie8: false
172
+ ) {
173
+ $legacy-support-for-ie6: $ie6;
174
+ $legacy-support-for-ie7: $ie7;
175
+ $legacy-support-for-ie8: $ie8;
176
+ }
177
+
178
+ @mixin capture-and-set-legacy-ie(
179
+ $ie6: false,
180
+ $ie7: false,
181
+ $ie8: false
182
+ ) {
183
+ @include capture-legacy-ie-matrix;
184
+ @include set-legacy-ie-support($ie6, $ie7, $ie8);
185
+ }
186
+
187
+ @mixin capture-and-adjust-legacy-ie(
188
+ $ie6: $legacy-support-for-ie6,
189
+ $ie7: $legacy-support-for-ie7,
190
+ $ie8: $legacy-support-for-ie8
191
+ ) {
192
+ @include capture-and-set-legacy-ie($ie6, $ie7, $ie8);
193
+ }
194
+
195
+ // Capture current browser support matrix, and set a new matrix of support.
196
+ @mixin capture-and-set-support(
197
+ $moz : false,
198
+ $webkit : false,
199
+ $o : false,
200
+ $ms : false,
201
+ $khtml : false,
202
+ $ie6 : false,
203
+ $ie7 : false,
204
+ $ie8 : false
205
+ ) {
206
+ // Capture the current state
207
+ @include capture-support-matrix;
208
+
209
+ // Change support settings
210
+ @include set-experimental-support($moz, $webkit, $o, $ms, $khtml);
211
+ @include set-legacy-ie-support($ie6, $ie7, $ie8);
212
+ }
213
+
214
+ // Capture current browser support matrix, and set a new matrix of support.
215
+ @mixin capture-and-adjust-support(
216
+ $moz : $experimental-support-for-mozilla,
217
+ $webkit : $experimental-support-for-webkit,
218
+ $o : $experimental-support-for-opera,
219
+ $ms : $experimental-support-for-microsoft,
220
+ $khtml : $experimental-support-for-khtml,
221
+ $ie6 : $legacy-support-for-ie6,
222
+ $ie7 : $legacy-support-for-ie7,
223
+ $ie8 : $legacy-support-for-ie8
224
+ ) {
225
+ @include capture-and-set-support($moz, $webkit, $o, $ms, $khtml, $ie6, $ie7, $ie8);
226
+ }
227
+
228
+
229
+ // This mixin allows you to change the experimental support settings for
230
+ // child (@content) styles.
231
+ @mixin with-only-support-for(
232
+ $moz : false,
233
+ $webkit : false,
234
+ $o : false,
235
+ $ms : false,
236
+ $khtml : false,
237
+ $ie6 : false,
238
+ $ie7 : false,
239
+ $ie8 : false
240
+ ) {
241
+ // Capture current state
242
+ $wo-experimental-matrix : capture-experimental-matrix();
243
+ $wo-legacy-ie-matrix : capture-legacy-ie-matrix();
244
+
245
+ // Set new states
246
+ @include set-experimental-support($moz, $webkit, $o, $ms, $khtml);
247
+ @include set-legacy-ie-support($ie6, $ie7, $ie8);
248
+
249
+ // Apply styles
250
+ @content;
251
+
252
+ // Return to original support settings
253
+ @include set-experimental-support($wo-experimental-matrix...);
254
+ @include set-legacy-ie-support($wo-legacy-ie-matrix...);
255
+ }
256
+
257
+ // This mixin is a shortcut for making slight adjustments to browser support
258
+ // for child (@content) styles
259
+ @mixin adjust-support-for(
260
+ $moz : $experimental-support-for-mozilla,
261
+ $webkit : $experimental-support-for-webkit,
262
+ $o : $experimental-support-for-opera,
263
+ $ms : $experimental-support-for-microsoft,
264
+ $khtml : $experimental-support-for-khtml,
265
+ $ie6 : $legacy-support-for-ie6,
266
+ $ie7 : $legacy-support-for-ie7,
267
+ $ie8 : $legacy-support-for-ie8
268
+ ) {
269
+ @include with-only-support-for($moz, $webkit, $o, $ms, $khtml, $ie6, $ie7, $ie8) {
270
+ @content;
271
+ }
272
+ }