locomotivecms_wagon 2.4.0.rc2 → 2.4.0

Sign up to get free protection for your applications and to get access to all the features.
Files changed (137) hide show
  1. checksums.yaml +4 -4
  2. data/generators/foundation/public/javascripts/vendor/foundation.js +10839 -6523
  3. data/generators/foundation/public/javascripts/vendor/foundation.min.js +5 -3
  4. data/generators/foundation/public/stylesheets/_settings.scss +455 -115
  5. data/generators/foundation/public/stylesheets/app.css +0 -3
  6. data/generators/foundation/public/stylesheets/app.scss +15 -6
  7. data/generators/foundation/public/stylesheets/foundation.css +4191 -1885
  8. data/generators/foundation/public/stylesheets/foundation6/_global.scss +106 -54
  9. data/generators/foundation/public/stylesheets/foundation6/components/_accordion-menu.scss +157 -14
  10. data/generators/foundation/public/stylesheets/foundation6/components/_accordion.scss +71 -28
  11. data/generators/foundation/public/stylesheets/foundation6/components/_badge.scss +17 -9
  12. data/generators/foundation/public/stylesheets/foundation6/components/_breadcrumbs.scss +33 -10
  13. data/generators/foundation/public/stylesheets/foundation6/components/_button-group.scss +168 -30
  14. data/generators/foundation/public/stylesheets/foundation6/components/_button.scss +165 -44
  15. data/generators/foundation/public/stylesheets/foundation6/components/_callout.scss +9 -18
  16. data/generators/foundation/public/stylesheets/foundation6/components/_card.scss +129 -0
  17. data/generators/foundation/public/stylesheets/foundation6/components/_close-button.scss +54 -13
  18. data/generators/foundation/public/stylesheets/foundation6/components/_drilldown.scss +108 -33
  19. data/generators/foundation/public/stylesheets/foundation6/components/_dropdown-menu.scss +215 -64
  20. data/generators/foundation/public/stylesheets/foundation6/components/_dropdown.scss +22 -7
  21. data/generators/foundation/public/stylesheets/foundation6/components/_flex-video.scss +1 -68
  22. data/generators/foundation/public/stylesheets/foundation6/components/_flex.scss +117 -0
  23. data/generators/foundation/public/stylesheets/foundation6/components/_float.scss +1 -1
  24. data/generators/foundation/public/stylesheets/foundation6/components/_label.scss +16 -8
  25. data/generators/foundation/public/stylesheets/foundation6/components/_media-object.scss +50 -10
  26. data/generators/foundation/public/stylesheets/foundation6/components/_menu-icon.scss +9 -0
  27. data/generators/foundation/public/stylesheets/foundation6/components/_menu.scss +373 -91
  28. data/generators/foundation/public/stylesheets/foundation6/components/_off-canvas.scss +418 -83
  29. data/generators/foundation/public/stylesheets/foundation6/components/_orbit.scss +17 -7
  30. data/generators/foundation/public/stylesheets/foundation6/components/_pagination.scss +77 -45
  31. data/generators/foundation/public/stylesheets/foundation6/components/_progress-bar.scss +16 -35
  32. data/generators/foundation/public/stylesheets/foundation6/components/_responsive-embed.scss +70 -0
  33. data/generators/foundation/public/stylesheets/foundation6/components/_reveal.scss +59 -34
  34. data/generators/foundation/public/stylesheets/foundation6/components/_slider.scss +17 -38
  35. data/generators/foundation/public/stylesheets/foundation6/components/_sticky.scss +5 -4
  36. data/generators/foundation/public/stylesheets/foundation6/components/_switch.scss +52 -36
  37. data/generators/foundation/public/stylesheets/foundation6/components/_table.scss +197 -79
  38. data/generators/foundation/public/stylesheets/foundation6/components/_tabs.scss +126 -67
  39. data/generators/foundation/public/stylesheets/foundation6/components/_thumbnail.scss +17 -4
  40. data/generators/foundation/public/stylesheets/foundation6/components/_title-bar.scss +61 -21
  41. data/generators/foundation/public/stylesheets/foundation6/components/_tooltip.scss +74 -24
  42. data/generators/foundation/public/stylesheets/foundation6/components/_top-bar.scss +128 -10
  43. data/generators/foundation/public/stylesheets/foundation6/components/_visibility.scss +6 -5
  44. data/generators/foundation/public/stylesheets/foundation6/forms/_checkbox.scss +14 -9
  45. data/generators/foundation/public/stylesheets/foundation6/forms/_error.scss +12 -5
  46. data/generators/foundation/public/stylesheets/foundation6/forms/_fieldset.scss +6 -6
  47. data/generators/foundation/public/stylesheets/foundation6/forms/_forms.scss +11 -9
  48. data/generators/foundation/public/stylesheets/foundation6/forms/_help-text.scss +1 -1
  49. data/generators/foundation/public/stylesheets/foundation6/forms/_input-group.scss +82 -10
  50. data/generators/foundation/public/stylesheets/foundation6/forms/_label.scss +2 -0
  51. data/generators/foundation/public/stylesheets/foundation6/forms/_meter.scss +116 -0
  52. data/generators/foundation/public/stylesheets/foundation6/forms/_progress.scss +94 -0
  53. data/generators/foundation/public/stylesheets/foundation6/forms/_range.scss +149 -0
  54. data/generators/foundation/public/stylesheets/foundation6/forms/_select.scss +36 -14
  55. data/generators/foundation/public/stylesheets/foundation6/forms/_text.scss +53 -27
  56. data/generators/foundation/public/stylesheets/foundation6/foundation.scss +59 -17
  57. data/generators/foundation/public/stylesheets/foundation6/grid/_classes.scss +100 -56
  58. data/generators/foundation/public/stylesheets/foundation6/grid/_column.scss +22 -22
  59. data/generators/foundation/public/stylesheets/foundation6/grid/_flex-grid.scss +164 -96
  60. data/generators/foundation/public/stylesheets/foundation6/grid/_grid.scss +19 -4
  61. data/generators/foundation/public/stylesheets/foundation6/grid/_gutter.scss +61 -10
  62. data/generators/foundation/public/stylesheets/foundation6/grid/_layout.scss +49 -5
  63. data/generators/foundation/public/stylesheets/foundation6/grid/_position.scss +14 -9
  64. data/generators/foundation/public/stylesheets/foundation6/grid/_row.scss +42 -15
  65. data/generators/foundation/public/stylesheets/foundation6/motion-ui/_classes.scss +11 -4
  66. data/generators/foundation/public/stylesheets/foundation6/motion-ui/effects/_fade.scss +4 -1
  67. data/generators/foundation/public/stylesheets/foundation6/motion-ui/effects/_zoom.scss +1 -1
  68. data/generators/foundation/public/stylesheets/foundation6/motion-ui/transitions/_slide.scss +1 -1
  69. data/generators/foundation/public/stylesheets/foundation6/motion-ui/util/_transition.scss +1 -1
  70. data/generators/foundation/public/stylesheets/foundation6/prototype/_arrow.scss +36 -0
  71. data/generators/foundation/public/stylesheets/foundation6/prototype/_border-box.scss +35 -0
  72. data/generators/foundation/public/stylesheets/foundation6/prototype/_border-none.scss +35 -0
  73. data/generators/foundation/public/stylesheets/foundation6/prototype/_bordered.scss +54 -0
  74. data/generators/foundation/public/stylesheets/foundation6/prototype/_box.scss +23 -0
  75. data/generators/foundation/public/stylesheets/foundation6/prototype/_display.scss +50 -0
  76. data/generators/foundation/public/stylesheets/foundation6/prototype/_font-styling.scss +95 -0
  77. data/generators/foundation/public/stylesheets/foundation6/prototype/_list-style-type.scss +95 -0
  78. data/generators/foundation/public/stylesheets/foundation6/prototype/_overflow.scss +72 -0
  79. data/generators/foundation/public/stylesheets/foundation6/prototype/_position.scss +114 -0
  80. data/generators/foundation/public/stylesheets/foundation6/prototype/_prototype.scss +87 -0
  81. data/generators/foundation/public/stylesheets/foundation6/prototype/_relation.scss +157 -0
  82. data/generators/foundation/public/stylesheets/foundation6/prototype/_rotate.scss +31 -0
  83. data/generators/foundation/public/stylesheets/foundation6/prototype/_rounded.scss +54 -0
  84. data/generators/foundation/public/stylesheets/foundation6/prototype/_separator.scss +96 -0
  85. data/generators/foundation/public/stylesheets/foundation6/prototype/_shadow.scss +43 -0
  86. data/generators/foundation/public/stylesheets/foundation6/prototype/_sizing.scss +73 -0
  87. data/generators/foundation/public/stylesheets/foundation6/prototype/_spacing.scss +204 -0
  88. data/generators/foundation/public/stylesheets/foundation6/prototype/_text-decoration.scss +48 -0
  89. data/generators/foundation/public/stylesheets/foundation6/prototype/_text-transformation.scss +48 -0
  90. data/generators/foundation/public/stylesheets/foundation6/prototype/_text-utilities.scss +88 -0
  91. data/generators/foundation/public/stylesheets/foundation6/settings/_settings.scss +454 -116
  92. data/generators/foundation/public/stylesheets/foundation6/typography/_alignment.scss +9 -8
  93. data/generators/foundation/public/stylesheets/foundation6/typography/_base.scss +128 -55
  94. data/generators/foundation/public/stylesheets/foundation6/typography/_helpers.scss +7 -4
  95. data/generators/foundation/public/stylesheets/foundation6/typography/_print.scss +22 -9
  96. data/generators/foundation/public/stylesheets/foundation6/typography/_typography.scss +0 -2
  97. data/generators/foundation/public/stylesheets/foundation6/util/_breakpoint.scss +213 -47
  98. data/generators/foundation/public/stylesheets/foundation6/util/_color.scss +105 -17
  99. data/generators/foundation/public/stylesheets/foundation6/util/_direction.scss +31 -0
  100. data/generators/foundation/public/stylesheets/foundation6/util/_flex.scss +85 -0
  101. data/generators/foundation/public/stylesheets/foundation6/util/_math.scss +72 -0
  102. data/generators/foundation/public/stylesheets/foundation6/util/_mixins.scss +161 -38
  103. data/generators/foundation/public/stylesheets/foundation6/util/_selector.scss +5 -3
  104. data/generators/foundation/public/stylesheets/foundation6/util/_typography.scss +26 -0
  105. data/generators/foundation/public/stylesheets/foundation6/util/_unit.scss +100 -17
  106. data/generators/foundation/public/stylesheets/foundation6/util/_util.scss +4 -5
  107. data/generators/foundation/public/stylesheets/foundation6/util/_value.scss +68 -25
  108. data/generators/foundation/public/stylesheets/foundation6/vendor/normalize-scss/sass/_normalize.scss +3 -0
  109. data/generators/foundation/public/stylesheets/foundation6/vendor/normalize-scss/sass/normalize/_import-now.scss +11 -0
  110. data/generators/foundation/public/stylesheets/foundation6/vendor/normalize-scss/sass/normalize/_normalize-mixin.scss +676 -0
  111. data/generators/foundation/public/stylesheets/foundation6/vendor/normalize-scss/sass/normalize/_variables.scss +36 -0
  112. data/generators/foundation/public/stylesheets/foundation6/vendor/normalize-scss/sass/normalize/_vertical-rhythm.scss +61 -0
  113. data/generators/foundation/public/stylesheets/foundation6/vendor/sassy-lists/stylesheets/functions/_contain.scss +31 -0
  114. data/generators/foundation/public/stylesheets/foundation6/vendor/sassy-lists/stylesheets/functions/_purge.scss +38 -0
  115. data/generators/foundation/public/stylesheets/foundation6/vendor/sassy-lists/stylesheets/functions/_remove.scss +31 -0
  116. data/generators/foundation/public/stylesheets/foundation6/vendor/sassy-lists/stylesheets/functions/_replace.scss +46 -0
  117. data/generators/foundation/public/stylesheets/foundation6/vendor/sassy-lists/stylesheets/functions/_to-list.scss +27 -0
  118. data/generators/foundation/public/stylesheets/foundation6/vendor/sassy-lists/stylesheets/helpers/_missing-dependencies.scss +25 -0
  119. data/generators/foundation/public/stylesheets/foundation6/vendor/sassy-lists/stylesheets/helpers/_true.scss +13 -0
  120. data/generators/foundation/public/stylesheets/foundation6/xy-grid/_cell.scss +169 -0
  121. data/generators/foundation/public/stylesheets/foundation6/xy-grid/_classes.scss +476 -0
  122. data/generators/foundation/public/stylesheets/foundation6/xy-grid/_collapse.scss +74 -0
  123. data/generators/foundation/public/stylesheets/foundation6/xy-grid/_frame.scss +85 -0
  124. data/generators/foundation/public/stylesheets/foundation6/xy-grid/_grid.scss +35 -0
  125. data/generators/foundation/public/stylesheets/foundation6/xy-grid/_gutters.scss +45 -0
  126. data/generators/foundation/public/stylesheets/foundation6/xy-grid/_layout.scss +33 -0
  127. data/generators/foundation/public/stylesheets/foundation6/xy-grid/_position.scss +28 -0
  128. data/generators/foundation/public/stylesheets/foundation6/xy-grid/_xy-grid.scss +51 -0
  129. data/lib/locomotive/wagon/tools/styled_yaml.rb +1 -1
  130. data/lib/locomotive/wagon/version.rb +1 -1
  131. data/locomotivecms_wagon.gemspec +2 -2
  132. data/spec/fixtures/cassettes/authenticate.yml +102 -48
  133. data/spec/fixtures/cassettes/delete.yml +519 -259
  134. data/spec/fixtures/cassettes/push.yml +2724 -1486
  135. metadata +61 -10
  136. data/generators/foundation/public/stylesheets/foundation6/motion-ui.scss +0 -4
  137. data/generators/foundation/public/stylesheets/foundation6/vendor/normalize.scss +0 -424
@@ -2,35 +2,90 @@
2
2
  // foundation.zurb.com
3
3
  // Licensed under MIT Open Source
4
4
 
5
+ @import 'math';
6
+
7
+ $contrast-warnings: true !default;
8
+
5
9
  ////
6
10
  /// @group functions
7
11
  ////
8
12
 
9
- /// Checks the lightness of `$color`, and if it passes the `$threshold` of lightness, it returns the `$yes` color. Otherwise, it returns the `$no` color. Use this function to dynamically output a foreground color based on a given background color.
13
+ /// Checks the luminance of `$color`.
10
14
  ///
11
- /// @param {color} $color - Color to check the lightness of.
12
- /// @param {color} $yes [$black] - Color to return if `$color` is light.
13
- /// @param {color} $no [$white] - Color to return if `$color` is dark.
14
- /// @param {percentage} $threshold [60%] - Threshold of lightness to check against.
15
+ /// @param {Color} $color - Color to check the luminance of.
15
16
  ///
16
- /// @returns {Color} The $yes color or $no color.
17
- @function foreground($color, $yes: $black, $no: $white, $threshold: 60%) {
18
- @if $color == transparent {
19
- $color: $body-background;
17
+ /// @returns {Number} The luminance of `$color`.
18
+ @function color-luminance($color) {
19
+ // Adapted from: https://github.com/LeaVerou/contrast-ratio/blob/gh-pages/color.js
20
+ // Formula: http://www.w3.org/TR/2008/REC-WCAG20-20081211/#relativeluminancedef
21
+ $rgba: red($color), green($color), blue($color);
22
+ $rgba2: ();
23
+
24
+ @for $i from 1 through 3 {
25
+ $rgb: nth($rgba, $i);
26
+ $rgb: $rgb / 255;
27
+
28
+ $rgb: if($rgb < 0.03928, $rgb / 12.92, pow(($rgb + 0.055) / 1.055, 2.4));
29
+
30
+ $rgba2: append($rgba2, $rgb);
20
31
  }
21
- @if (lightness($color) > $threshold) {
22
- @return $yes;
32
+
33
+ @return 0.2126 * nth($rgba2, 1) + 0.7152 * nth($rgba2, 2) + 0.0722 * nth($rgba2, 3);
34
+ }
35
+
36
+ /// Checks the contrast ratio of two colors.
37
+ ///
38
+ /// @param {Color} $color1 - First color to compare.
39
+ /// @param {Color} $color2 - Second color to compare.
40
+ ///
41
+ /// @returns {Number} The contrast ratio of the compared colors.
42
+ @function color-contrast($color1, $color2) {
43
+ // Adapted from: https://github.com/LeaVerou/contrast-ratio/blob/gh-pages/color.js
44
+ // Formula: http://www.w3.org/TR/2008/REC-WCAG20-20081211/#contrast-ratiodef
45
+ $luminance1: color-luminance($color1) + 0.05;
46
+ $luminance2: color-luminance($color2) + 0.05;
47
+ $ratio: $luminance1 / $luminance2;
48
+
49
+ @if $luminance2 > $luminance1 {
50
+ $ratio: 1 / $ratio;
23
51
  }
24
- @else {
25
- @return $no;
52
+
53
+ $ratio: round($ratio * 10) / 10;
54
+
55
+ @return $ratio;
56
+ }
57
+
58
+ /// Checks the luminance of `$base`, and returns the color from `$colors` (list of colors) that has the most contrast.
59
+ ///
60
+ /// @param {Color} $base - Color to check luminance.
61
+ /// @param {List} $colors [($white, $black)] - Colors to compare.
62
+ /// @param {Number} $tolerance [$global-color-pick-contrast-tolerance] - Contrast tolerance.
63
+ ///
64
+ /// @returns {Color} the color from `$colors` (list of colors) that has the most contrast.
65
+ @function color-pick-contrast($base, $colors: ($white, $black), $tolerance: $global-color-pick-contrast-tolerance) {
66
+ $contrast: color-contrast($base, nth($colors, 1));
67
+ $best: nth($colors, 1);
68
+
69
+ @for $i from 2 through length($colors) {
70
+ $current-contrast: color-contrast($base, nth($colors, $i));
71
+ @if ($current-contrast - $contrast > $tolerance) {
72
+ $contrast: color-contrast($base, nth($colors, $i));
73
+ $best: nth($colors, $i);
74
+ }
75
+ }
76
+
77
+ @if ($contrast-warnings and $contrast < 3) {
78
+ @warn "Contrast ratio of #{$best} on #{$base} is pretty bad, just #{$contrast}";
26
79
  }
80
+
81
+ @return $best;
27
82
  }
28
83
 
29
- /// Scales a color to be lighter if it's light, or darker if it's dark. Use this function to tint a color appropriate to its lightness.
84
+ /// Scales a color to be darker if it's light, or lighter if it's dark. Use this function to tint a color appropriate to its lightness.
30
85
  ///
31
- /// @param {color} $color - Color to scale.
32
- /// @param {percentage} $scale [5%] - Amount to scale up or down.
33
- /// @param {percentage} $threshold [40%] - Threshold of lightness to check against.
86
+ /// @param {Color} $color - Color to scale.
87
+ /// @param {Percentage} $scale [5%] - Amount to scale up or down.
88
+ /// @param {Percentage} $threshold [40%] - Threshold of lightness to check against.
34
89
  ///
35
90
  /// @returns {Color} A scaled color.
36
91
  @function smart-scale($color, $scale: 5%, $threshold: 40%) {
@@ -39,3 +94,36 @@
39
94
  }
40
95
  @return scale-color($color, $lightness: $scale);
41
96
  }
97
+
98
+ /// Get color from foundation-palette
99
+ ///
100
+ /// @param {key} color key from foundation-palette
101
+ ///
102
+ /// @returns {Color} color from foundation-palette
103
+ @function get-color($key) {
104
+ @if map-has-key($foundation-palette, $key) {
105
+ @return map-get($foundation-palette, $key);
106
+ }
107
+ @else {
108
+ @error 'given $key is not available in $foundation-palette';
109
+ }
110
+ }
111
+
112
+ /// Transfers the colors in the `$foundation-palette`map into variables, such as `$primary-color` and `$secondary-color`. Call this mixin below the Global section of your settings file to properly migrate your codebase.
113
+ @mixin add-foundation-colors() {
114
+ @if map-has-key($foundation-palette, primary) {
115
+ $primary-color: map-get($foundation-palette, primary) !global;
116
+ }
117
+ @if map-has-key($foundation-palette, secondary) {
118
+ $secondary-color: map-get($foundation-palette, secondary) !global;
119
+ }
120
+ @if map-has-key($foundation-palette, success) {
121
+ $success-color: map-get($foundation-palette, success) !global;
122
+ }
123
+ @if map-has-key($foundation-palette, warning) {
124
+ $warning-color: map-get($foundation-palette, warning) !global;
125
+ }
126
+ @if map-has-key($foundation-palette, alert) {
127
+ $alert-color: map-get($foundation-palette, alert) !global;
128
+ }
129
+ }
@@ -0,0 +1,31 @@
1
+ // Foundation for Sites by ZURB
2
+ // foundation.zurb.com
3
+ // Licensed under MIT Open Source
4
+
5
+ ////
6
+ /// @group functions
7
+ ////
8
+
9
+ /// Returns the opposite direction of $dir
10
+ ///
11
+ /// @param {Keyword} $dir - Used direction between "top", "right", "bottom" and "left".
12
+ /// @return {Keyword} Opposite direction of $dir
13
+ @function direction-opposite(
14
+ $dir
15
+ ) {
16
+ $dirs: (top, right, bottom, left);
17
+ $place: index($dirs, $dir);
18
+
19
+ @if $place == null {
20
+ @error 'direction-opposite: Invalid $dir parameter, expected a value from "#{$dirs}", found "#{$dir}".';
21
+ @return null;
22
+ }
23
+
24
+ // Calcul the opposite place in a circle, with a starting index of 1
25
+ $length: length($dirs);
26
+ $demi: $length / 2;
27
+ $opposite-place: (($place + $demi - 1) % $length) + 1;
28
+
29
+ @return nth($dirs, $opposite-place);
30
+ }
31
+
@@ -0,0 +1,85 @@
1
+ $-zf-flex-justify: (
2
+ 'left': flex-start,
3
+ 'right': flex-end,
4
+ 'center': center,
5
+ 'justify': space-between,
6
+ 'spaced': space-around,
7
+ );
8
+
9
+ $-zf-flex-align: (
10
+ 'top': flex-start,
11
+ 'bottom': flex-end,
12
+ 'middle': center,
13
+ 'stretch': stretch,
14
+ );
15
+
16
+ $-zf-flex-direction: (
17
+ 'row': row,
18
+ 'row-reverse': row-reverse,
19
+ 'column': column,
20
+ 'column-reverse': column-reverse,
21
+ );
22
+
23
+ /// Enables flexbox by adding `display: flex` to the element.
24
+ @mixin flex {
25
+ display: flex;
26
+ }
27
+
28
+ /// Horizontally or vertically aligns the items within a flex container.
29
+ ///
30
+ /// @param {Keyword} $x [null] - Horizontal alignment to use. Can be `left`, `right`, `center`, `justify`, or `spaced`. Or, set it to `null` (the default) to not set horizontal alignment.
31
+ /// @param {Keyword} $y [null] - Vertical alignment to use. Can be `top`, `bottom`, `middle`, or `stretch`. Or, set it to `null` (the default) to not set vertical alignment.
32
+ @mixin flex-align($x: null, $y: null) {
33
+ @if $x {
34
+ @if map-has-key($-zf-flex-justify, $x) {
35
+ $x: map-get($-zf-flex-justify, $x);
36
+ }
37
+ @else {
38
+ @warn 'flex-grid-row-align(): #{$x} is not a valid value for horizontal alignment. Use left, right, center, justify, or spaced.';
39
+ }
40
+ }
41
+
42
+ @if $y {
43
+ @if map-has-key($-zf-flex-align, $y) {
44
+ $y: map-get($-zf-flex-align, $y);
45
+ }
46
+ @else {
47
+ @warn 'flex-grid-row-align(): #{$y} is not a valid value for vertical alignment. Use top, bottom, middle, or stretch.';
48
+ }
49
+ }
50
+
51
+ justify-content: $x;
52
+ align-items: $y;
53
+ }
54
+
55
+ /// Vertically align a single column within a flex row. Apply this mixin to a flex column.
56
+ ///
57
+ /// @param {Keyword} $y [null] - Vertical alignment to use. Can be `top`, `bottom`, `middle`, or `stretch`. Or, set it to `null` (the default) to not set vertical alignment.
58
+ @mixin flex-align-self($y: null) {
59
+ @if $y {
60
+ @if map-has-key($-zf-flex-align, $y) {
61
+ $y: map-get($-zf-flex-align, $y);
62
+ }
63
+ @else {
64
+ @warn 'flex-grid-column-align(): #{$y} is not a valid value for alignment. Use top, bottom, middle, or stretch.';
65
+ }
66
+ }
67
+
68
+ align-self: $y;
69
+ }
70
+
71
+ /// Changes the source order of a flex child. Children with lower numbers appear first in the layout.
72
+ /// @param {Number} $order [0] - Order number to apply.
73
+ @mixin flex-order($order: 0) {
74
+ order: $order;
75
+ }
76
+
77
+ /// Change flex-direction
78
+ /// @param {Keyword} $direction [row] - Flex direction to use. Can be
79
+ /// - row (default): same as text direction
80
+ /// - row-reverse: opposite to text direction
81
+ /// - column: same as row but top to bottom
82
+ /// - column-reverse: same as row-reverse top to bottom
83
+ @mixin flex-direction($direction: row) {
84
+ flex-direction: $direction;
85
+ }
@@ -0,0 +1,72 @@
1
+ // Foundation for Sites by ZURB
2
+ // foundation.zurb.com
3
+ // Licensed under MIT Open Source
4
+
5
+ ////
6
+ /// @group functions
7
+ ////
8
+
9
+ /// Finds the greatest common divisor of two integers.
10
+ ///
11
+ /// @param {Number} $a - First number to compare.
12
+ /// @param {Number} $b - Second number to compare.
13
+ ///
14
+ /// @returns {Number} The greatest common divisor.
15
+ @function gcd($a, $b) {
16
+ // From: http://rosettacode.org/wiki/Greatest_common_divisor#JavaScript
17
+ @if ($b != 0) {
18
+ @return gcd($b, $a % $b);
19
+ }
20
+ @else {
21
+ @return abs($a);
22
+ }
23
+ }
24
+
25
+ /// Handles decimal exponents by trying to convert them into a fraction and then use a nth-root-algorithm for parts of the calculation
26
+ ///
27
+ /// @param {Number} $base - The base number.
28
+ /// @param {Number} $exponent - The exponent.
29
+ ///
30
+ /// @returns {Number} The product of the exponentiation.
31
+ @function pow($base, $exponent, $prec: 16) {
32
+ @if (floor($exponent) != $exponent) {
33
+ $prec2 : pow(10, $prec);
34
+ $exponent: round($exponent * $prec2);
35
+ $denominator: gcd($exponent, $prec2);
36
+ @return nth-root(pow($base, $exponent / $denominator), $prec2 / $denominator, $prec);
37
+ }
38
+
39
+ $value: $base;
40
+ @if $exponent > 1 {
41
+ @for $i from 2 through $exponent {
42
+ $value: $value * $base;
43
+ }
44
+ }
45
+ @else if $exponent < 1 {
46
+ @for $i from 0 through -$exponent {
47
+ $value: $value / $base;
48
+ }
49
+ }
50
+
51
+ @return $value;
52
+ }
53
+
54
+ @function nth-root($num, $n: 2, $prec: 12) {
55
+ // From: http://rosettacode.org/wiki/Nth_root#JavaScript
56
+ $x: 1;
57
+
58
+ @for $i from 0 through $prec {
59
+ $x: 1 / $n * (($n - 1) * $x + ($num / pow($x, $n - 1)));
60
+ }
61
+
62
+ @return $x;
63
+ }
64
+
65
+ /// Calculates the height as a percentage of the width for a given ratio.
66
+ /// @param {List} $ratio - Ratio to use to calculate the height, formatted as `x by y`.
67
+ /// @return {Number} A percentage value for the height relative to the width of a responsive container.
68
+ @function ratio-to-percentage($ratio) {
69
+ $w: nth($ratio, 1);
70
+ $h: nth($ratio, 3);
71
+ @return $h / $w * 100%;
72
+ }
@@ -6,49 +6,81 @@
6
6
  /// @group functions
7
7
  ////
8
8
 
9
+ /// Creates an inner box-shadow for only one side
10
+ ///
11
+ /// @param {Keyword} $side - Side the shadow is supposed to appear. Can be `top`, `left`, `right` or `bottom`.
12
+ /// @param {Number} $size - Width for the target side.
13
+ /// @param {Color} $color - Color of the shadow.
14
+ @mixin inner-side-shadow(
15
+ $side: bottom,
16
+ $size: 20px,
17
+ $color: rgba($black, 0.25)
18
+ ) {
19
+
20
+ $helper: round($size * 0.65);
21
+
22
+ @if ($side == top) {
23
+ box-shadow: inset 0 $helper $size (-1)*$helper $color;
24
+ } @else if ($side == left) {
25
+ box-shadow: inset $helper 0 $size (-1)*$helper $color;
26
+ } @else if ($side == right) {
27
+ box-shadow: inset (-1)*$helper 0 $size (-1)*$helper $color;
28
+ } @else if ($side == bottom) {
29
+ box-shadow: inset 0 (-1)*$helper $size (-1)*$helper $color;
30
+ }
31
+ }
32
+
9
33
  /// Creates a CSS triangle, which can be used for dropdown arrows, dropdown pips, and more. Use this mixin inside a `&::before` or `&::after` selector, to attach the triangle to an existing element.
34
+ ///
10
35
  /// @param {Number} $triangle-size - Width of the triangle.
11
36
  /// @param {Color} $triangle-color - Color of the triangle.
12
- /// @param {Keyword} $triangle-direction - Direction the triangle points. Can be `top`, `right`, `bottom`, or `left`.
37
+ /// @param {Keyword} $triangle-direction - Direction the triangle points. Can be `up`, `right`, `down`, or `left`.
13
38
  @mixin css-triangle(
14
39
  $triangle-size,
15
40
  $triangle-color,
16
41
  $triangle-direction
17
42
  ) {
18
- content: '';
19
43
  display: block;
20
44
  width: 0;
21
45
  height: 0;
46
+
22
47
  border: inset $triangle-size;
23
48
 
49
+ content: '';
50
+
24
51
  @if ($triangle-direction == down) {
25
- border-color: $triangle-color transparent transparent;
52
+ border-bottom-width: 0;
26
53
  border-top-style: solid;
54
+ border-color: $triangle-color transparent transparent;
27
55
  }
28
56
  @if ($triangle-direction == up) {
29
- border-color: transparent transparent $triangle-color;
57
+ border-top-width: 0;
30
58
  border-bottom-style: solid;
59
+ border-color: transparent transparent $triangle-color;
31
60
  }
32
61
  @if ($triangle-direction == right) {
33
- border-color: transparent transparent transparent $triangle-color;
62
+ border-right-width: 0;
34
63
  border-left-style: solid;
64
+ border-color: transparent transparent transparent $triangle-color;
35
65
  }
36
66
  @if ($triangle-direction == left) {
37
- border-color: transparent $triangle-color transparent transparent;
67
+ border-left-width: 0;
38
68
  border-right-style: solid;
69
+ border-color: transparent $triangle-color transparent transparent;
39
70
  }
40
71
  }
41
72
 
42
73
  /// Creates a menu icon with a set width, height, number of bars, and colors. The mixin uses the height of the icon and the weight of the bars to determine spacing. <div class="docs-example-burger"></div>
43
- /// @param {Color} $color - Color to use for the icon.
44
- /// @param {Color} $color-hover - Color to use when the icon is hovered over.
45
- /// @param {Number} $width - Width of the icon.
46
- /// @param {Number} $height - Height of the icon.
47
- /// @param {Number} $weight - Height of individual bars in the icon.
48
- /// @param {Number} $bars - Number of bars in the icon.
74
+ ///
75
+ /// @param {Color} $color [$black] - Color to use for the icon.
76
+ /// @param {Color} $color-hover [$dark-gray] - Color to use when the icon is hovered over.
77
+ /// @param {Number} $width [20px] - Width of the icon.
78
+ /// @param {Number} $height [16px] - Height of the icon.
79
+ /// @param {Number} $weight [2px] - Height of individual bars in the icon.
80
+ /// @param {Number} $bars [3] - Number of bars in the icon.
49
81
  @mixin hamburger(
50
- $color: black,
51
- $color-hover: #666,
82
+ $color: $black,
83
+ $color-hover: $dark-gray,
52
84
  $width: 20px,
53
85
  $height: 16px,
54
86
  $weight: 2px,
@@ -59,33 +91,39 @@
59
91
  $hover-shadow: ();
60
92
 
61
93
  // Spacing between bars is calculated based on the total height of the icon and the weight of each bar
62
- $spacing: floor(($height - ($weight * $bars)) / ($bars - 1));
94
+ $spacing: ($height - ($weight * $bars)) / ($bars - 1);
95
+
96
+ @if unit($spacing) == 'px' {
97
+ $spacing: floor($spacing);
98
+ }
99
+
100
+ @for $i from 2 through $bars {
101
+ $offset: ($weight + $spacing) * ($i - 1);
102
+ $shadow: append($shadow, 0 $offset 0 $color, comma);
103
+ }
63
104
 
64
105
  // Icon container
65
106
  position: relative;
66
107
  display: inline-block;
67
108
  vertical-align: middle;
68
- cursor: pointer;
69
109
  width: $width;
70
110
  height: $height;
111
+ cursor: pointer;
71
112
 
72
113
  // Icon bars
73
114
  &::after {
74
- content: '';
75
115
  position: absolute;
76
- display: block;
77
- width: 100%;
78
- height: $weight;
79
- background: $color;
80
116
  top: 0;
81
117
  left: 0;
82
118
 
83
- @for $i from 2 through $bars {
84
- $offset: ($weight + $spacing) * ($i - 1);
85
- $shadow: append($shadow, 0 $offset 0 $color, comma);
86
- }
119
+ display: block;
120
+ width: 100%;
121
+ height: $weight;
87
122
 
123
+ background: $color;
88
124
  box-shadow: $shadow;
125
+
126
+ content: '';
89
127
  }
90
128
 
91
129
  // Hover state
@@ -105,29 +143,39 @@
105
143
 
106
144
  /// Adds a downward-facing triangle as a background image to an element. The image is formatted as an SVG, making it easy to change the color. Because Internet Explorer doesn't support encoded SVGs as background images, a PNG fallback is also included.
107
145
  /// There are two PNG fallbacks: a black triangle and a white triangle. The one used depends on the lightness of the input color.
146
+ ///
108
147
  /// @param {Color} $color [$black] - Color to use for the triangle.
109
148
  @mixin background-triangle($color: $black) {
110
- $rgb: 'rgb(#{red($color)}, #{green($color)}, #{blue($color)})';
149
+ $rgb: 'rgb%28#{round(red($color))}, #{round(green($color))}, #{round(blue($color))}%29';
111
150
 
112
- background-image: url('data:image/svg+xml;utf8,<svg xmlns="http://www.w3.org/2000/svg" version="1.1" width="32" height="24" viewBox="0 0 32 24"><polygon points="0,0 32,0 16,24" style="fill: #{$rgb}"></polygon></svg>');
151
+ background-image: url("data:image/svg+xml;utf8,<svg xmlns='http://www.w3.org/2000/svg' version='1.1' width='32' height='24' viewBox='0 0 32 24'><polygon points='0,0 32,0 16,24' style='fill: #{$rgb}'></polygon></svg>");
113
152
 
114
153
  @media screen and (min-width:0\0) {
115
- @if lightness($color) < 50% {
154
+ @if lightness($color) < 60% {
155
+ // White triangle
116
156
  background-image: url('data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAACAAAAAYCAYAAACbU/80AAAAGXRFWHRTb2Z0d2FyZQBBZG9iZSBJbWFnZVJlYWR5ccllPAAAAIpJREFUeNrEkckNgDAMBBfRkEt0ObRBBdsGXUDgmQfK4XhH2m8czQAAy27R3tsw4Qfe2x8uOO6oYLb6GlOor3GF+swURAOmUJ+RwtEJs9WvTGEYxBXqI1MQAZhCfUQKRzDMVj+TwrAIV6jvSUEkYAr1LSkcyTBb/V+KYfX7xAeusq3sLDtGH3kEGACPWIflNZfhRQAAAABJRU5ErkJggg==');
117
157
  }
118
158
  @else {
159
+ // Black triangle
119
160
  background-image: url('data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAACAAAAAYCAYAAACbU/80AAAAGXRFWHRTb2Z0d2FyZQBBZG9iZSBJbWFnZVJlYWR5ccllPAAAAMBJREFUeNrEllsOhCAMRVszC9IlzU7KCmVHTJsoMWYMUtpyv9BgbuXQB5ZSdgBYYY4ycgBivk8KYFsQMfMiTTBP4o3nUzCKzOabLJbLy2/g31evGkAginR4/ZegKH5qX3bJCscA3t0x3kgO5tQFyhhFf50xRqFLbyMUNJQzgyjGS/wgCpvKqkRBpuWrE4V9d+1E4dPUXqIg107SQOE/2DRQxMwTDygIInVDET9T3lCoj/6j/VCmGjZOl2lKpZ8AAwDQP7zIimDGFQAAAABJRU5ErkJggg==');
120
161
  }
121
162
  }
122
163
  }
123
164
 
124
165
  /// Applies the micro clearfix hack popularized by Nicolas Gallagher. Include this mixin on a container if its children are all floated, to give the container a proper height.
166
+ /// The clearfix is augmented with specific styles to prevent borders in flexbox environments
125
167
  /// @link http://nicolasgallagher.com/micro-clearfix-hack/ Micro Clearfix Hack
168
+ /// @link http://danisadesigner.com/blog/flexbox-clear-fix-pseudo-elements/ Flexbox fix
126
169
  @mixin clearfix {
127
170
  &::before,
128
171
  &::after {
129
- content: ' ';
130
172
  display: table;
173
+ content: ' ';
174
+
175
+ @if $global-flexbox {
176
+ flex-basis: 0;
177
+ order: 1;
178
+ }
131
179
  }
132
180
 
133
181
  &::after {
@@ -136,9 +184,10 @@
136
184
  }
137
185
 
138
186
  /// Adds CSS for a "quantity query" selector that automatically sizes elements based on how many there are inside a container.
187
+ /// @link http://alistapart.com/article/quantity-queries-for-css Quantity Queries for CSS
188
+ ///
139
189
  /// @param {Number} $max - Maximum number of items to detect. The higher this number is, the more CSS that's required to cover each number of items.
140
190
  /// @param {Keyword} $elem [li] - Tag to use for sibling selectors.
141
- /// @link http://alistapart.com/article/quantity-queries-for-css Quantity Queries for CSS
142
191
  @mixin auto-width($max, $elem: li) {
143
192
  @for $i from 2 through $max {
144
193
  &:nth-last-child(#{$i}):first-child,
@@ -150,41 +199,115 @@
150
199
 
151
200
  /// Removes the focus ring around an element when a mouse input is detected.
152
201
  @mixin disable-mouse-outline {
153
- [data-whatinput="mouse"] & {
202
+ [data-whatinput='mouse'] & {
154
203
  outline: 0;
155
204
  }
156
205
  }
157
206
 
158
207
  /// Makes an element visually hidden, but still accessible to keyboards and assistive devices.
159
208
  /// @link http://snook.ca/archives/html_and_css/hiding-content-for-accessibility Hiding Content for Accessibility
209
+ /// @link http://hugogiraudel.com/2016/10/13/css-hide-and-seek/
160
210
  @mixin element-invisible {
161
211
  position: absolute !important;
162
212
  width: 1px;
163
213
  height: 1px;
214
+ padding: 0;
164
215
  overflow: hidden;
165
- clip: rect(0, 0, 0, 0);
216
+ clip: rect(0,0,0,0);
217
+ white-space: nowrap;
218
+ clip-path: inset(50%);
219
+ border: 0;
166
220
  }
167
221
 
168
222
  /// Reverses the CSS output created by the `element-invisible()` mixin.
169
223
  @mixin element-invisible-off {
170
224
  position: static !important;
171
- height: auto;
172
225
  width: auto;
226
+ height: auto;
173
227
  overflow: visible;
174
228
  clip: auto;
229
+ white-space: normal;
230
+ clip-path: none;
175
231
  }
176
232
 
177
- /// Vertically and horizontally centers an element using `transform`.
233
+ /// Vertically centers the element inside of its first non-static parent,
234
+ /// @link http://www.sitepoint.com/centering-with-sass/ Centering With Sass
178
235
  @mixin vertical-center {
179
236
  position: absolute;
180
237
  top: 50%;
238
+ transform: translateY(-50%);
239
+ }
240
+
241
+ /// Horizontally centers the element inside of its first non-static parent,
242
+ /// @link http://www.sitepoint.com/centering-with-sass/ Centering With Sass
243
+ @mixin horizontal-center {
244
+ position: absolute;
181
245
  left: 50%;
182
- transform: translate(-50%, -50%);
246
+ transform: translateX(-50%);
183
247
  }
184
248
 
185
- /// Vertically centers an element using `transform`.
186
- @mixin v-align-middle {
249
+ /// Absolutely centers the element inside of its first non-static parent,
250
+ /// @link http://www.sitepoint.com/centering-with-sass/ Centering With Sass
251
+ @mixin absolute-center {
187
252
  position: absolute;
188
253
  top: 50%;
189
- transform: translateY(-50%);
254
+ left: 50%;
255
+ transform: translate(-50%, -50%);
256
+ }
257
+
258
+ /// Iterates through breakpoints defined in `$breakpoint-classes` and prints the CSS inside the mixin at each breakpoint's media query. Use this with the grid, or any other component that has responsive classes.
259
+ ///
260
+ /// @param {Boolean} $small [true] - If `false`, the mixin will skip the `small` breakpoint. Use this with components that don't prefix classes with `small-`, only `medium-` and up.
261
+ /// @param {Boolean} $auto-insert-breakpoints [true] - If `false`, the mixin will iterate over breakpoints without doing the media query itself. Useful for more complex media query generation as in the margin grid.
262
+ @mixin -zf-each-breakpoint($small: true, $auto-insert-breakpoints: true) {
263
+ $list: $breakpoint-classes;
264
+
265
+ @if not $small {
266
+ $list: sl-remove($list, $-zf-zero-breakpoint);
267
+ }
268
+
269
+ @each $name in $list {
270
+ $-zf-size: $name !global;
271
+
272
+ @if $auto-insert-breakpoints {
273
+ @include breakpoint($name) {
274
+ @content;
275
+ }
276
+ }
277
+ @else {
278
+ @content;
279
+ }
280
+ }
281
+ }
282
+
283
+ /// Generate the `@content` passed to the mixin with a value `$-zf-bp-value` related to a breakpoint, depending on the `$name` parameter:
284
+ /// - For a single value, `$-zf-bp-value` is this value.
285
+ /// - For a breakpoint name, `$-zf-bp-value` is the corresponding breakpoint value in `$map`.
286
+ /// - For "auto", `$-zf-bp-value` is the corresponding breakpoint value in `$map` and is passed to `@content`, which is made responsive for each breakpoint of `$map`.
287
+ /// @param {Number|Array|Keyword} $name [auto] - Single value, breakpoint name, or list of breakpoint names to use. "auto" by default.
288
+ /// @param {Number|Map} $map - Map of breakpoints and values or single value to use.
289
+ @mixin -zf-breakpoint-value(
290
+ $name: auto,
291
+ $map: null
292
+ ) {
293
+ @if $name == auto and type-of($map) == 'map' {
294
+ // "auto"
295
+ @each $k, $v in $map {
296
+ @include breakpoint($k) {
297
+ @include -zf-breakpoint-value($v, $map) {
298
+ @content;
299
+ }
300
+ }
301
+ }
302
+ }
303
+ @else {
304
+ // breakpoint name
305
+ @if type-of($name) == 'string' {
306
+ $name: -zf-get-bp-val($map, $name);
307
+ }
308
+
309
+ // breakpoint value
310
+ $-zf-bp-value: $name !global;
311
+ @content;
312
+ }
190
313
  }