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,10 +1,9 @@
1
1
  // Filter
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
- $filter-support: -moz, -webkit, not -ms, not -o, not -khtml;
4
+ // The prefixed support threshold for css filter effects.
5
+ // Defaults to the $graceful-usage-threshold.
6
+ $filter-support-threshold: $graceful-usage-threshold !default;
8
7
 
9
8
 
10
9
  // Provides cross-browser support for the upcoming (?) css3 filter property.
@@ -12,12 +11,16 @@ $filter-support: -moz, -webkit, not -ms, not -o, not -khtml;
12
11
  // The filter argument should adhere to the standard css3 syntax
13
12
  // for the filter property.
14
13
  @mixin filter($filters) {
15
- @include experimental(filter, $filters, $filter-support...);
14
+ @include prefixed-properties(css-filters, $filter-support-threshold,(
15
+ filter: $filters
16
+ ));
16
17
  }
17
18
 
18
19
  // @private Apply filter-margins
19
20
  @mixin apply-filter-margin($position, $width) {
20
- @include experimental(filter-margin-#{$position}, $width, $filter-support...);
21
+ @include prefixed-properties(css-filters, $filter-support-threshold,(
22
+ filter-margin-#{$position}: $width
23
+ ));
21
24
  }
22
25
 
23
26
  // filter-margin-top
@@ -34,10 +37,14 @@ $filter-support: -moz, -webkit, not -ms, not -o, not -khtml;
34
37
 
35
38
  // filter-margin
36
39
  @mixin filter-margin($widths) {
37
- @include experimental(filter-margin, $widths, $filter-support...);
40
+ @include prefixed-properties(css-filters, $filter-support-threshold,(
41
+ filter-margin: $widths
42
+ ));
38
43
  }
39
44
 
40
45
  // color-interpolation-filters (auto | sRGB | linearRGB )
41
46
  @mixin color-interpolation-filters($value) {
42
- @include experimental(color-interpolation-filters, $value, $filter-support...);
43
- }
47
+ @include prefixed-properties(css-filters, $filter-support-threshold,(
48
+ color-interpolation-filters: $value
49
+ ));
50
+ }
@@ -1,294 +1,147 @@
1
- @import "shared";
2
-
3
- // NOTE:
4
- // All mixins for the @box spec have been written assuming they'll be fed property values that
5
- // correspond to the standard spec. Some mixins can be fed values from the @box spec, but don't
6
- // rely on it. The `legacy-order` mixin will increment the value fed to it because the @box
7
- // `box-ordinal-group` property begins indexing at 1, while the modern `order` property begins
8
- // indexing at 0.
9
-
10
- // ---------------------------------------------------------------------- | @flex
11
-
12
- // September 2012 Candidate Recommendation (http://www.w3.org/TR/2012/CR-css3-flexbox-20120918/)
13
- // NOTE: FF did not support wrapping until version ??. Because the `display: flex` property
14
- // is wrapped in a `@supports (flex-wrap: wrap)` block (when $flex-wrap-required or the $wrap
15
- // argument to the `display-flex` mixin is set to `true`), it will Just Work(TM) when support is
16
- // finally added
17
- // Chrome 21 (prefixed)
18
- // Opera 12.1 (unprefixed)
19
- // Firefox 20 (unprefixed)
20
- $flex-support: not -moz, -webkit, not -ms, not -o, not -khtml !default;
21
-
22
- // if `true`, `$flex-legacy-enabled` is treated as false and an `@supports` block is added to
23
- // the display property to hide the standard value from versions of Firefox that support the
24
- // unprefixed properties, but do not support wrapping
25
- // (this includes suppressing the automatic emittion of @box properties)
26
- $flex-wrap-required : false !default;
27
-
28
- // ---------------------------------------------------------------------- | @flexbox
29
-
30
- // March 2012 Working Draft (http://www.w3.org/TR/2012/WD-css3-flexbox-20120322/)
31
- // Chrome 17 (prefixed)
32
- // Internet Explorer 10 (prefixed)
33
- $flexbox-support: not -moz, -webkit, -ms, not -o, not -khtml, not standard !default;
34
-
35
- // ---------------------------------------------------------------------- | @box
36
-
37
- // July 2009 Working Draft (http://www.w3.org/TR/2009/WD-css3-flexbox-20090723/)
38
- // NOTE: no browser that implements this spec is known to support `box-lines: multiple`
39
- // Chrome 4? (prefixed)
40
- // Safari 3.1 (prefixed)
41
- // Firefox <20 (prefixed)
42
- $box-support: -moz, -webkit, not -ms, not -o, not -khtml, not standard !default;
43
-
44
- // If `true`, the @box properties will be emitted as part of the normal mixin call
45
- // (if this is false, you're still free to explicitly call the legacy mixins yourself)
46
- $flex-legacy-enabled: false !default;
47
-
48
- // ====================================================================================================
49
- // | Common
50
- // ====================================================================================================
51
-
52
- // function for converting a value from the standard specification to one that is comparable from
53
- // an older specification
54
- @function flex-translate-value($value, $version: box) {
55
- $value: unquote($value);
56
-
57
- @if $value == flex {
58
- @return if($version == box, box, flexbox);
59
- } @else if $value == inline-flex {
60
- @return if($version == box, inline-box, inline-flexbox);
61
- } @else if $value == flex-start {
62
- @return start;
63
- } @else if $value == flex-end {
64
- @return end;
65
- } @else if $value == space-between {
66
- @return justify;
67
- } @else if $value == space-around { // @box doesn't have a value equivalent to `space-around`
68
- @return if($version == box, justify, distribute);
69
- }
70
- @return $value;
1
+ // There are two ways to use the flexbox module.
2
+ // If you're using the final version of the spec,
3
+ // you can use the property mixins as elsewhere in
4
+ // the css3 module.
5
+ //
6
+ // You can also use the flexbox prefixing mixin `flexbox`.
7
+ // This mixin takes an optional `$version` argument which
8
+ // allows you to specify which spec version the properties
9
+ // are using so that they will be prefixed correctly.
10
+ //
11
+ // Example:
12
+ //
13
+ // .flex-column {
14
+ // /* For flexbox spec v1 */
15
+ // @include flexbox((
16
+ // display: box,
17
+ // box-orient: vertical,
18
+ // ), $version: 1);
19
+ //
20
+ // /* For flexbox spec v2 */
21
+ // @include flexbox((
22
+ // display: flexbox,
23
+ // flex-direction: column,
24
+ // ), $version: 2);
25
+ //
26
+ // /* Latest Spec */
27
+ // @include flexbox((
28
+ // display: flex,
29
+ // flex-direction: column,
30
+ // ));
31
+ // }
32
+ //
33
+ // Which compiles to:
34
+ //
35
+ // .flex-row {
36
+ // /* For flexbox spec v1 */
37
+ // display: -moz-box;
38
+ // -moz-box-orient: vertical;
39
+ // display: -webkit-box;
40
+ // -webkit-box-orient: vertical;
41
+ //
42
+ // /* For flexbox spec v2 */
43
+ // display: -ms-flexbox;
44
+ // -ms-flex-direction: column;
45
+ //
46
+ // /* Latest Spec */
47
+ // display: -webkit-flex;
48
+ // -webkit-flex-direction: column;
49
+ // display: flex;
50
+ // flex-direction: column;
51
+ // }
52
+
53
+ @import "compass/support";
54
+
55
+ $flexbox-support-threshold: $critical-usage-threshold !default;
56
+
57
+
58
+ // @private
59
+ $flexbox-capability-options: (
60
+ (full-support: true),
61
+ (partial-support: true, spec-versions: 3)
62
+ );
63
+
64
+ @mixin flexbox($properties, $version: null) {
65
+ $capability-options: $flexbox-capability-options;
66
+ @if $version {
67
+ $capability-options: (partial-support: true, spec-versions: $version);
68
+ }
69
+
70
+ @include with-each-prefix(flexbox, $flexbox-support-threshold, $capability-options) {
71
+ // Don't output unprefixed versions when the spec version is not the final version
72
+ @if $version and $current-prefix or not $version or $version == 3 {
73
+ @each $prop, $value in $properties {
74
+ @if $prop == display {
75
+ display: prefix-identifier($value);
76
+ } @else {
77
+ @include prefix-prop($prop, $value);
78
+ }
79
+ }
80
+ }
81
+ }
82
+ }
83
+
84
+ @mixin display-flex {
85
+ @include flexbox((display: flex));
86
+ }
87
+
88
+ // Values: row | row-reverse | column | column-reverse
89
+ @mixin flex-direction($direction) {
90
+ @include flexbox((flex-direction: $direction));
91
+ }
92
+
93
+ // Values: nowrap | wrap | wrap-reverse
94
+ @mixin flex-wrap($wrap) {
95
+ @include flexbox((flex-wrap: $wrap));
96
+ }
97
+
98
+ // Shorthand for flex-direction and flex-wrap.
99
+ @mixin flex-flow($flow) {
100
+ @include flexbox((flex-flow: $flow));
101
+ }
102
+
103
+ // Accepts an integer
104
+ @mixin order($order) {
105
+ @include flexbox((order: $order));
106
+ }
107
+
108
+ // Shorthand for flex-grow, flex-shrink and optionally flex-basis.
109
+ // Space separated, in that order.
110
+ @mixin flex($flex) {
111
+ @include flexbox((flex: $flex));
112
+ }
113
+
114
+ // Accepts a number.
115
+ @mixin flex-grow($flex-grow) {
116
+ @include flexbox((flex-grow: $flex-grow));
71
117
  }
72
118
 
73
- @function flex-support-either() {
74
- $common: ();
75
- @for $i from 1 through length($flex-support) {
76
- $common: append($common, nth($flex-support, $i) or nth($flexbox-support, $i), comma);
77
- }
78
- @return $common;
119
+ // Accepts a number.
120
+ @mixin flex-shrink($flex-shrink) {
121
+ @include flexbox((flex-shrink: $flex-shrink));
79
122
  }
80
123
 
81
- // ====================================================================================================
82
- // | Display Property
83
- // ====================================================================================================
84
-
85
- // $type: flex | inline-flex
86
- @mixin display-flex($type: flex, $wrap: $flex-wrap-required, $legacy: $flex-legacy-enabled) {
87
- @if $legacy and not $wrap {
88
- @include legacy-display-flex($type);
89
- }
90
-
91
- @include experimental-value(display, flex-translate-value($type, flexbox), $flexbox-support...);
92
-
93
- // if `$wrap` is true, then we need to suppress official support as generated by the `experimental()`
94
- // mixin so that we can insert it inside an `@supports` block
95
- $flex-support-standard: true;
96
- $flex-support-list: $flex-support;
97
- @if length($flex-support) > 5 {
98
- $flex-support-standard: nth($flex-support, 6);
99
- // a `slice()` function would really be handy here...
100
- $flex-support-list: nth($flex-support, 1), nth($flex-support, 2), nth($flex-support, 3), nth($flex-support, 4), nth($flex-support, 5);
101
- }
102
- $flex-support-list: append($flex-support-list, if($wrap, false, $flex-support-standard));
103
- @include experimental-value(display, $type, $flex-support-list...);
104
-
105
- @if $wrap and $flex-support-standard {
106
- @supports (flex-wrap: wrap) {
107
- display: $type;
108
- }
109
- }
124
+ // Accepts any legal value for the width property.
125
+ @mixin flex-basis($flex-basis) {
126
+ @include flexbox((flex-basis: $flex-basis));
110
127
  }
111
128
 
112
- @mixin legacy-display-flex($type: flex) {
113
- @include experimental-value(display, flex-translate-value($type, box), $box-support...);
129
+ // Legal values: flex-start | flex-end | center | space-between | space-around
130
+ @mixin justify-content($justify-content) {
131
+ @include flexbox((justify-content: $justify-content));
114
132
  }
115
133
 
116
- // ====================================================================================================
117
- // | Flex Container Properties
118
- // ====================================================================================================
119
-
120
- // $value: <'flex-direction'> || <'flex-wrap'>
121
- @mixin flex-flow($value: row nowrap, $wrap: $flex-wrap-required, $legacy: $flex-legacy-enabled) {
122
- @if $legacy and not $wrap {
123
- @include legacy-flex-flow($value);
124
- }
125
-
126
- @include experimental(flex-flow, $value, flex-support-either()...);
127
- }
128
-
129
- @mixin legacy-flex-flow($value: row nowrap) {
130
- @if length($value) > 1 { // @box version doesn't have a shorthand
131
- @include legacy-flex-direction(nth($value, 1));
132
- @include legacy-flex-wrap(nth($value, 2));
133
- } @else {
134
- $value: unquote($value);
135
- @if $value == row or $value == row-reverse or $value == column or $value == column-reverse {
136
- @include legacy-flex-direction($value);
137
- } @else {
138
- @include legacy-flex-wrap($value);
139
- }
140
- }
141
- }
142
-
143
- // ----------------------------------------------------------------------
144
-
145
- // $value: row | row-reverse | column | column-reverse
146
- @mixin flex-direction($value: row, $wrap: $flex-wrap-required, $legacy: $flex-legacy-enabled) {
147
- @if $legacy and not $wrap {
148
- @include legacy-flex-direction($value);
149
- }
150
-
151
- @include experimental(flex-direction, $value, flex-support-either()...);
152
- }
153
-
154
- @mixin legacy-flex-direction($value: row) {
155
- $value: unquote($value);
156
- @include experimental(box-orient, if($value == row or $value == row-reverse, horizontal, vertical), $box-support...);
157
- @include experimental(box-direction, if($value == row-reverse or $value == column-reverse, reverse, normal), $box-support...);
158
- }
159
-
160
- // ----------------------------------------------------------------------
161
-
162
- // $value: nowrap | wrap | wrap-reverse
163
- @mixin flex-wrap($value: nowrap, $wrap: $flex-wrap-required, $legacy: $flex-legacy-enabled) {
164
- @if $legacy and not $wrap {
165
- @include legacy-flex-wrap($value);
166
- }
167
-
168
- @include experimental(flex-wrap, $value, flex-support-either()...);
169
- }
170
-
171
- @mixin legacy-flex-wrap($value: nowrap) {
172
- // NOTE: @box has no equivalent of wrap-reverse
173
- @include experimental(box-lines, if($value == nowrap, single, multiple), $box-support...);
174
- }
175
-
176
- // ----------------------------------------------------------------------
177
-
178
- // Distributing extra space along the "main axis"
179
- // $value: flex-start | flex-end | center | space-between | space-around
180
- @mixin justify-content($value: flex-start, $wrap: $flex-wrap-required, $legacy: $flex-legacy-enabled) {
181
- @if $legacy and not $wrap {
182
- @include legacy-justify-content($value);
183
- }
184
-
185
- @include experimental(flex-pack, flex-translate-value($value, flexbox), $flexbox-support...);
186
- @include experimental(justify-content, $value, $flex-support...);
134
+ // Legal values: flex-start | flex-end | center | baseline | stretch
135
+ @mixin align-items($align-items) {
136
+ @include flexbox((align-items: $align-items));
187
137
  }
188
138
 
189
- @mixin legacy-justify-content($value: flex-start) {
190
- @include experimental(box-pack, flex-translate-value($value, box), $box-support...);
191
- }
192
-
193
- // ----------------------------------------------------------------------
194
-
195
- // Distributing extra space along the "cross axis"
196
- // $value: flex-start | flex-end | center | space-between | space-around | stretch
197
- @mixin align-content($value: flex-start, $wrap: $flex-wrap-required, $legacy: $flex-legacy-enabled) {
198
- @if $legacy and not $wrap {
199
- @include legacy-align-content($value);
200
- }
201
-
202
- @include experimental(flex-line-pack, flex-translate-value($value, flexbox), $flexbox-support...);
203
- @include experimental(align-content, $value, $flex-support...);
204
- }
205
-
206
- @mixin legacy-align-content($value: flex-start) {
207
- @include experimental(box-align, flex-translate-value($value, box), $box-support...);
208
- }
209
-
210
- // ----------------------------------------------------------------------
211
-
212
- // Align items along the "cross axis"
213
- // $value: flex-start | flex-end | center | baseline | stretch
214
- @mixin align-items($value: stretch) { // the flex container
215
- // There is no @box version of this property
216
- @include experimental(flex-align, flex-translate-value($value, flexbox), $flexbox-support...);
217
- @include experimental(align-items, $value, $flex-support...);
218
- }
219
-
220
- // ====================================================================================================
221
- // | Flex Item Properties
222
- // ====================================================================================================
223
-
224
- // $value: none | [ <'flex-grow'> <'flex-shrink'>? || <'flex-basis'> ]
225
- @mixin flex($value: 0 1 auto, $wrap: $flex-wrap-required, $legacy: $flex-legacy-enabled) {
226
- $value: unquote($value);
227
- @if $legacy and unitless(nth($value, 1)) {
228
- // @box version does not have a shorthand, see `legacy-flex-grow`
229
- @include legacy-flex-grow(nth($value, 1));
230
- }
231
-
232
- @include experimental(flex, $value, flex-support-either()...);
233
- }
234
-
235
- // ----------------------------------------------------------------------
236
-
237
- // $value: Integer
238
- @mixin flex-grow($value: 0, $wrap: $flex-wrap-required, $legacy: $flex-legacy-enabled) {
239
- @if $legacy and not $wrap {
240
- @include legacy-flex-grow($value);
241
- }
242
-
243
- // There is no @flexbox version of this property
244
- @include experimental(flex-grow, $value, $flex-support...);
245
- }
246
-
247
- @mixin legacy-flex-grow($value: 0) {
248
- @include experimental(box-flex, $value, $box-support...);
249
- }
250
-
251
- // ----------------------------------------------------------------------
252
-
253
- // $value: Integer
254
- @mixin flex-shrink($value: 1) {
255
- // There is no @box version of this property
256
- // There is no @flexbox version of this property
257
- @include experimental(flex-shrink, $value, $flex-support...);
258
- }
259
-
260
- // ----------------------------------------------------------------------
261
-
262
- // $value: united number (eg: 100px)
263
- @mixin flex-basis($value: auto) {
264
- // There is no @box version of this property
265
- // There is no @flexbox version of this property
266
- @include experimental(flex-basis, $value, $flex-support...);
267
- }
268
-
269
- // ----------------------------------------------------------------------
270
-
271
- // Align items along the "cross axis" -- overrides `align-items` value on individual items
272
- // $value: auto | flex-start | flex-end | center | baseline | stretch
273
- @mixin align-self($value: auto) { // children of flex containers
274
- // There is no @box version of this property
275
- @include experimental(flex-item-align, flex-translate-value($value, flexbox), $flexbox-support...);
276
- @include experimental(align-self, $value, $flex-support...);
277
- }
278
-
279
- // ----------------------------------------------------------------------
280
-
281
- // $value: Integer
282
- @mixin order($value: 0, $wrap: $flex-wrap-required, $legacy: $flex-legacy-enabled) {
283
- @if $legacy and not $wrap {
284
- @include legacy-order($value);
285
- }
286
-
287
- @include experimental(flex-order, $value, $flexbox-support...);
288
- @include experimental(order, $value, $flex-support...);
139
+ // Legal values: auto | flex-start | flex-end | center | baseline | stretch
140
+ @mixin align-self($align-self) {
141
+ @include flexbox((align-self: $align-self));
289
142
  }
290
143
 
291
- @mixin legacy-order($value: 0) {
292
- // the @box spec starts the ordering at 1 instead of 0 like the modern specs
293
- @include experimental(box-ordinal-group, $value + 1, $box-support...);
144
+ // Legal values: flex-start | flex-end | center | space-between | space-around | stretch
145
+ @mixin align-content($align-content) {
146
+ @include flexbox((align-content: $align-content));
294
147
  }