foundation-rails 6.3.1.0 → 6.4.1.0

Sign up to get free protection for your applications and to get access to all the features.
Files changed (139) hide show
  1. checksums.yaml +4 -4
  2. data/bower.json +3 -3
  3. data/lib/foundation/rails/version.rb +1 -1
  4. data/lib/generators/foundation/install_generator.rb +1 -1
  5. data/lib/generators/foundation/templates/_settings.scss +291 -48
  6. data/vendor/assets/js/entries/foundation-plugins.js +25 -0
  7. data/vendor/assets/js/entries/foundation.js +101 -0
  8. data/vendor/assets/js/entries/plugins/foundation.abide.js +4 -0
  9. data/vendor/assets/js/entries/plugins/foundation.accordion.js +4 -0
  10. data/vendor/assets/js/entries/plugins/foundation.accordionMenu.js +5 -0
  11. data/vendor/assets/js/entries/plugins/foundation.core.js +21 -0
  12. data/vendor/assets/js/entries/plugins/foundation.drilldown.js +4 -0
  13. data/vendor/assets/js/entries/plugins/foundation.dropdown.js +5 -0
  14. data/vendor/assets/js/entries/plugins/foundation.dropdownMenu.js +4 -0
  15. data/vendor/assets/js/entries/plugins/foundation.equalizer.js +4 -0
  16. data/vendor/assets/js/entries/plugins/foundation.interchange.js +4 -0
  17. data/vendor/assets/js/entries/plugins/foundation.magellan.js +4 -0
  18. data/vendor/assets/js/entries/plugins/foundation.offcanvas.js +4 -0
  19. data/vendor/assets/js/entries/plugins/foundation.orbit.js +5 -0
  20. data/vendor/assets/js/entries/plugins/foundation.responsiveAccordionTabs.js +5 -0
  21. data/vendor/assets/js/entries/plugins/foundation.responsiveMenu.js +5 -0
  22. data/vendor/assets/js/entries/plugins/foundation.responsiveToggle.js +5 -0
  23. data/vendor/assets/js/entries/plugins/foundation.reveal.js +4 -0
  24. data/vendor/assets/js/entries/plugins/foundation.slider.js +5 -0
  25. data/vendor/assets/js/entries/plugins/foundation.smoothScroll.js +5 -0
  26. data/vendor/assets/js/entries/plugins/foundation.sticky.js +5 -0
  27. data/vendor/assets/js/entries/plugins/foundation.tabs.js +5 -0
  28. data/vendor/assets/js/entries/plugins/foundation.toggler.js +5 -0
  29. data/vendor/assets/js/entries/plugins/foundation.tooltip.js +4 -0
  30. data/vendor/assets/js/entries/plugins/foundation.util.box.js +4 -0
  31. data/vendor/assets/js/entries/plugins/foundation.util.imageLoader.js +5 -0
  32. data/vendor/assets/js/entries/plugins/foundation.util.keyboard.js +4 -0
  33. data/vendor/assets/js/entries/plugins/foundation.util.mediaQuery.js +4 -0
  34. data/vendor/assets/js/entries/plugins/foundation.util.motion.js +5 -0
  35. data/vendor/assets/js/entries/plugins/foundation.util.nest.js +5 -0
  36. data/vendor/assets/js/entries/plugins/foundation.util.timer.js +5 -0
  37. data/vendor/assets/js/entries/plugins/foundation.util.touch.js +7 -0
  38. data/vendor/assets/js/entries/plugins/foundation.util.triggers.js +5 -0
  39. data/vendor/assets/js/foundation.abide.js.es6 +18 -15
  40. data/vendor/assets/js/foundation.accordion.js.es6 +37 -23
  41. data/vendor/assets/js/foundation.accordionMenu.js.es6 +96 -51
  42. data/vendor/assets/js/foundation.core.js.es6 +46 -87
  43. data/vendor/assets/js/foundation.drilldown.js.es6 +47 -29
  44. data/vendor/assets/js/foundation.dropdown.js.es6 +84 -122
  45. data/vendor/assets/js/foundation.dropdownMenu.js.es6 +44 -28
  46. data/vendor/assets/js/foundation.equalizer.js.es6 +18 -17
  47. data/vendor/assets/js/foundation.interchange.js.es6 +26 -19
  48. data/vendor/assets/js/foundation.js.es6 +8 -3
  49. data/vendor/assets/js/foundation.magellan.js.es6 +36 -30
  50. data/vendor/assets/js/foundation.offcanvas.js.es6 +148 -36
  51. data/vendor/assets/js/foundation.orbit.js.es6 +26 -18
  52. data/vendor/assets/js/foundation.plugin.js.es6 +54 -0
  53. data/vendor/assets/js/foundation.positionable.js.es6 +206 -0
  54. data/vendor/assets/js/{foundation.zf.responsiveAccordionTabs.js.es6 → foundation.responsiveAccordionTabs.js.es6} +33 -30
  55. data/vendor/assets/js/foundation.responsiveMenu.js.es6 +37 -29
  56. data/vendor/assets/js/foundation.responsiveToggle.js.es6 +17 -16
  57. data/vendor/assets/js/foundation.reveal.js.es6 +61 -79
  58. data/vendor/assets/js/foundation.slider.js.es6 +33 -18
  59. data/vendor/assets/js/foundation.smoothScroll.js.es6 +135 -0
  60. data/vendor/assets/js/foundation.sticky.js.es6 +25 -17
  61. data/vendor/assets/js/foundation.tabs.js.es6 +35 -27
  62. data/vendor/assets/js/foundation.toggler.js.es6 +15 -13
  63. data/vendor/assets/js/foundation.tooltip.js.es6 +100 -108
  64. data/vendor/assets/js/foundation.util.box.js.es6 +114 -78
  65. data/vendor/assets/js/foundation.util.core.js.es6 +52 -0
  66. data/vendor/assets/js/foundation.util.imageLoader.js.es6 +45 -0
  67. data/vendor/assets/js/foundation.util.keyboard.js.es6 +41 -31
  68. data/vendor/assets/js/foundation.util.mediaQuery.js.es6 +59 -55
  69. data/vendor/assets/js/foundation.util.motion.js.es6 +4 -5
  70. data/vendor/assets/js/foundation.util.nest.js.es6 +9 -23
  71. data/vendor/assets/js/{foundation.util.timerAndImageLoader.js.es6 → foundation.util.timer.js.es6} +2 -42
  72. data/vendor/assets/js/foundation.util.touch.js.es6 +91 -294
  73. data/vendor/assets/js/foundation.util.triggers.js.es6 +199 -141
  74. data/vendor/assets/scss/_global.scss +29 -1
  75. data/vendor/assets/scss/components/_accordion-menu.scss +148 -13
  76. data/vendor/assets/scss/components/_accordion.scss +5 -0
  77. data/vendor/assets/scss/components/_breadcrumbs.scss +26 -9
  78. data/vendor/assets/scss/components/_button-group.scss +4 -4
  79. data/vendor/assets/scss/components/_button.scss +59 -12
  80. data/vendor/assets/scss/components/_card.scss +10 -2
  81. data/vendor/assets/scss/components/_drilldown.scss +90 -41
  82. data/vendor/assets/scss/components/_dropdown-menu.scss +52 -6
  83. data/vendor/assets/scss/components/_dropdown.scss +8 -1
  84. data/vendor/assets/scss/components/_flex.scss +85 -2
  85. data/vendor/assets/scss/components/_menu.scss +267 -162
  86. data/vendor/assets/scss/components/_off-canvas.scss +159 -45
  87. data/vendor/assets/scss/components/_pagination.scss +1 -1
  88. data/vendor/assets/scss/components/_reveal.scss +13 -11
  89. data/vendor/assets/scss/components/_slider.scss +0 -1
  90. data/vendor/assets/scss/components/_sticky.scss +1 -0
  91. data/vendor/assets/scss/components/_table.scss +7 -6
  92. data/vendor/assets/scss/components/_tabs.scss +1 -1
  93. data/vendor/assets/scss/components/_title-bar.scss +1 -1
  94. data/vendor/assets/scss/components/_tooltip.scss +74 -21
  95. data/vendor/assets/scss/components/_top-bar.scss +2 -0
  96. data/vendor/assets/scss/forms/_fieldset.scss +0 -1
  97. data/vendor/assets/scss/forms/_meter.scss +7 -1
  98. data/vendor/assets/scss/forms/_select.scss +4 -3
  99. data/vendor/assets/scss/forms/_text.scss +11 -2
  100. data/vendor/assets/scss/foundation.scss +17 -3
  101. data/vendor/assets/scss/grid/_flex-grid.scss +3 -52
  102. data/vendor/assets/scss/prototype/_arrow.scss +36 -0
  103. data/vendor/assets/scss/prototype/_border-box.scss +35 -0
  104. data/vendor/assets/scss/prototype/_border-none.scss +35 -0
  105. data/vendor/assets/scss/prototype/_bordered.scss +54 -0
  106. data/vendor/assets/scss/prototype/_box.scss +23 -0
  107. data/vendor/assets/scss/prototype/_display.scss +50 -0
  108. data/vendor/assets/scss/prototype/_font-styling.scss +95 -0
  109. data/vendor/assets/scss/prototype/_list-style-type.scss +95 -0
  110. data/vendor/assets/scss/prototype/_overflow.scss +72 -0
  111. data/vendor/assets/scss/prototype/_position.scss +114 -0
  112. data/vendor/assets/scss/prototype/_prototype.scss +91 -0
  113. data/vendor/assets/scss/prototype/_relation.scss +157 -0
  114. data/vendor/assets/scss/prototype/_rotate.scss +31 -0
  115. data/vendor/assets/scss/prototype/_rounded.scss +54 -0
  116. data/vendor/assets/scss/prototype/_separator.scss +96 -0
  117. data/vendor/assets/scss/prototype/_shadow.scss +43 -0
  118. data/vendor/assets/scss/prototype/_sizing.scss +73 -0
  119. data/vendor/assets/scss/prototype/_spacing.scss +204 -0
  120. data/vendor/assets/scss/prototype/_text-decoration.scss +48 -0
  121. data/vendor/assets/scss/prototype/_text-transformation.scss +48 -0
  122. data/vendor/assets/scss/prototype/_text-utilities.scss +88 -0
  123. data/vendor/assets/scss/prototype/_typescale.scss +20 -0
  124. data/vendor/assets/scss/settings/_settings.scss +291 -48
  125. data/vendor/assets/scss/typography/_base.scss +2 -2
  126. data/vendor/assets/scss/typography/_helpers.scss +6 -4
  127. data/vendor/assets/scss/util/_breakpoint.scss +60 -1
  128. data/vendor/assets/scss/util/_color.scss +8 -5
  129. data/vendor/assets/scss/util/_mixins.scss +45 -5
  130. data/vendor/assets/scss/xy-grid/_cell.scss +179 -0
  131. data/vendor/assets/scss/xy-grid/_classes.scss +455 -0
  132. data/vendor/assets/scss/xy-grid/_collapse.scss +54 -0
  133. data/vendor/assets/scss/xy-grid/_frame.scss +54 -0
  134. data/vendor/assets/scss/xy-grid/_grid.scss +56 -0
  135. data/vendor/assets/scss/xy-grid/_gutters.scss +45 -0
  136. data/vendor/assets/scss/xy-grid/_layout.scss +33 -0
  137. data/vendor/assets/scss/xy-grid/_position.scss +28 -0
  138. data/vendor/assets/scss/xy-grid/_xy-grid.scss +52 -0
  139. metadata +73 -4
@@ -18,14 +18,34 @@ $dropdownmenu-arrow-color: $anchor-color !default;
18
18
  /// @type Length
19
19
  $dropdownmenu-arrow-size: 6px !default;
20
20
 
21
+ /// Sets dropdown menu arrow padding for aligning the arrow correctly.
22
+ /// @type Length
23
+ $dropdownmenu-arrow-padding: 1.5rem !default;
24
+
21
25
  /// Minimum width of dropdown sub-menus.
22
26
  /// @type Length
23
27
  $dropdownmenu-min-width: 200px !default;
24
28
 
25
- /// Background color for dropdowns.
29
+ /// Background color for top level items.
26
30
  /// @type Color
27
31
  $dropdownmenu-background: $white !default;
28
32
 
33
+ /// Background color for dropdowns.
34
+ /// @type Color
35
+ $dropdownmenu-submenu-background: $dropdownmenu-background !default;
36
+
37
+ /// Padding for top level items.
38
+ /// @type Number
39
+ $dropdownmenu-padding: $global-menu-padding !default;
40
+
41
+ /// Sets dropdown menu nested margin
42
+ /// @type Number
43
+ $dropdownmenu-nested-margin: 0 !default;
44
+
45
+ /// Padding for sub-menu items.
46
+ /// @type Number
47
+ $dropdownmenu-submenu-padding: $dropdownmenu-padding !default;
48
+
29
49
  /// Border for dropdown sub-menus.
30
50
  /// @type List
31
51
  $dropdownmenu-border: 1px solid $medium-gray !default;
@@ -35,12 +55,22 @@ $dropdownmenu-border: 1px solid $medium-gray !default;
35
55
  // @type Length
36
56
  $dropdownmenu-border-width: nth($dropdownmenu-border, 1);
37
57
 
38
- @mixin left-right-arrows {
58
+ /// Text color of an active dropdown menu item. Explicit override for menu defaults
59
+ /// @type Color
60
+ $dropdown-menu-item-color-active: get-color(primary) !default;
61
+
62
+ /// Background color of an active dropdown menu item. Explicit override for menu defaults
63
+ /// @type Color
64
+ $dropdown-menu-item-background-active: transparent !default;
65
+
66
+ @mixin zf-dropdown-left-right-arrows {
39
67
  > a::after {
40
68
  #{$global-right}: 14px;
41
69
  }
42
70
 
43
71
  &.opens-left > a::after {
72
+ right: auto;
73
+ left: 5px;
44
74
  @include css-triangle($dropdownmenu-arrow-size, $dropdownmenu-arrow-color, left);
45
75
  }
46
76
 
@@ -70,7 +100,7 @@ $dropdownmenu-border-width: nth($dropdownmenu-border, 1);
70
100
  @if $dropdownmenu-arrows {
71
101
  > li.is-dropdown-submenu-parent > a {
72
102
  position: relative;
73
- padding-#{$global-right}: 1.5rem;
103
+ padding-#{$global-right}: $dropdownmenu-arrow-padding;
74
104
  }
75
105
 
76
106
  > li.is-dropdown-submenu-parent > a::after {
@@ -90,6 +120,7 @@ $dropdownmenu-border-width: nth($dropdownmenu-border, 1);
90
120
  > .is-dropdown-submenu {
91
121
  right: 100%;
92
122
  left: auto;
123
+ top: 0;
93
124
  }
94
125
  }
95
126
 
@@ -101,7 +132,7 @@ $dropdownmenu-border-width: nth($dropdownmenu-border, 1);
101
132
  }
102
133
 
103
134
  @if $dropdownmenu-arrows {
104
- @include left-right-arrows;
135
+ @include zf-dropdown-left-right-arrows;
105
136
  }
106
137
  }
107
138
  }
@@ -116,12 +147,23 @@ $dropdownmenu-border-width: nth($dropdownmenu-border, 1);
116
147
 
117
148
  a {
118
149
  @include disable-mouse-outline;
150
+ padding: $dropdownmenu-padding;
151
+ }
152
+
153
+ // Active state
154
+ .is-active > a {
155
+ background: $dropdown-menu-item-background-active;
156
+ color: $dropdown-menu-item-color-active;
119
157
  }
120
158
 
121
159
  .no-js & ul {
122
160
  display: none;
123
161
  }
124
162
 
163
+ .nested.is-dropdown-submenu {
164
+ @include menu-nested($dropdownmenu-nested-margin);
165
+ }
166
+
125
167
  &.vertical {
126
168
  @include dropdown-menu-direction(vertical);
127
169
  }
@@ -199,11 +241,15 @@ $dropdownmenu-border-width: nth($dropdownmenu-border, 1);
199
241
  min-width: $dropdownmenu-min-width;
200
242
 
201
243
  border: $dropdownmenu-border;
202
- background: $dropdownmenu-background;
244
+ background: $dropdownmenu-submenu-background;
245
+
246
+ .dropdown & a {
247
+ padding: $dropdownmenu-submenu-padding;
248
+ }
203
249
 
204
250
  .is-dropdown-submenu-parent {
205
251
  @if $dropdownmenu-arrows {
206
- @include left-right-arrows;
252
+ @include zf-dropdown-left-right-arrows;
207
253
  }
208
254
  }
209
255
 
@@ -43,19 +43,26 @@ $dropdown-sizes: (
43
43
  position: absolute;
44
44
  z-index: 10;
45
45
 
46
- display: block;
47
46
  width: $dropdown-width;
48
47
  padding: $dropdown-padding;
49
48
 
50
49
  visibility: hidden;
50
+ display: none;
51
51
  border: $dropdown-border;
52
52
  border-radius: $dropdown-radius;
53
53
  background-color: $dropdown-background;
54
54
 
55
55
  font-size: $dropdown-font-size;
56
56
 
57
+
58
+ // Allow an intermittent state to do positioning before making visible.
59
+ &.is-opening {
60
+ display: block;
61
+ }
62
+
57
63
  &.is-open {
58
64
  visibility: visible;
65
+ display: block;
59
66
  }
60
67
  }
61
68
 
@@ -1,10 +1,90 @@
1
+ // Foundation for Sites by ZURB
2
+ // foundation.zurb.com
3
+ // Licensed under MIT Open Source
4
+
5
+ ////
6
+ /// @group Flexbox Utilities
7
+ ////
8
+ //
9
+ /// Default value for the count of source ordering`
10
+ /// @type Number
11
+ $flex-source-ordering-count: 6 !default;
12
+
13
+ /// Quickly disable/enable Responsive breakpoints for Vanilla Flex Helpers.
14
+ /// @type Boolean
15
+ $flexbox-responsive-breakpoints: true !default;
16
+
17
+ @mixin flex-helpers {
18
+ .flex-container {
19
+ @include flex;
20
+ }
21
+
22
+ .flex-child-auto {
23
+ flex: 1 1 auto;
24
+ }
25
+
26
+ .flex-child-grow {
27
+ flex: 1 0 auto;
28
+ }
29
+
30
+ .flex-child-shrink {
31
+ flex: 0 1 auto;
32
+ }
33
+
34
+ @each $dir, $prop in $-zf-flex-direction {
35
+ .flex-dir-#{$dir} {
36
+ @include flex-direction($prop);
37
+ }
38
+ }
39
+
40
+ @if ($flexbox-responsive-breakpoints) {
41
+ // Loop through Responsive Breakpoints
42
+ @each $size in $breakpoint-classes {
43
+ @include breakpoint($size) {
44
+ @if $size != $-zf-zero-breakpoint {
45
+ .#{$size}-flex-container {
46
+ @include flex;
47
+ }
48
+
49
+ .#{$size}-flex-child-auto {
50
+ flex: 1 1 auto;
51
+ }
52
+
53
+ .#{$size}-flex-child-grow {
54
+ flex: 1 0 auto;
55
+ }
56
+
57
+ .#{$size}-flex-child-shrink {
58
+ flex: 0 1 auto;
59
+ }
60
+
61
+ @each $dir, $prop in $-zf-flex-direction {
62
+ .#{$size}-flex-dir-#{$dir} {
63
+ @include flex-direction($prop);
64
+ }
65
+ }
66
+ }
67
+ }
68
+ }
69
+ }
70
+ }
71
+
1
72
  @mixin foundation-flex-classes {
2
73
  // Horizontal alignment using justify-content
3
- @each $hdir, $prop in map-remove($-zf-flex-justify, left) {
74
+ @each $hdir, $prop in map-remove($-zf-flex-justify, 'left') {
4
75
  .align-#{$hdir} {
5
76
  @include flex-align($x: $hdir);
6
77
  }
7
78
  }
79
+
80
+ // Horizontal alignment Specifically for Vertical Menu
81
+ @each $hdir, $prop in map-remove($-zf-flex-justify, 'left', 'justify', 'spaced') {
82
+ .align-#{$hdir} {
83
+ &.vertical.menu > li > a {
84
+ @include flex-align($x: $hdir);
85
+ }
86
+ }
87
+ }
8
88
 
9
89
  // Vertical alignment using align-items and align-self
10
90
  @each $vdir, $prop in $-zf-flex-align {
@@ -25,10 +105,13 @@
25
105
 
26
106
  // Source ordering
27
107
  @include -zf-each-breakpoint {
28
- @for $i from 1 through 6 {
108
+ @for $i from 1 through $flex-source-ordering-count {
29
109
  .#{$-zf-size}-order-#{$i} {
30
110
  @include flex-order($i);
31
111
  }
32
112
  }
33
113
  }
114
+
115
+ // Vanilla Flexbox Helpers
116
+ @include flex-helpers;
34
117
  }
@@ -12,11 +12,15 @@ $menu-margin: 0 !default;
12
12
 
13
13
  /// Left-hand margin of a nested menu.
14
14
  /// @type Number
15
- $menu-margin-nested: 1rem !default;
15
+ $menu-nested-margin: $global-menu-nested-margin !default;
16
16
 
17
- /// Padding for items in a menu.
17
+ /// Padding for items in a pill menu.
18
18
  /// @type Number
19
- $menu-item-padding: 0.7rem 1rem !default;
19
+ $menu-items-padding: $global-menu-padding !default;
20
+
21
+ /// margin for items in a simple menu.
22
+ /// @type Number
23
+ $menu-simple-margin: 1rem !default;
20
24
 
21
25
  /// Text color of an active menu item.
22
26
  /// @type Color
@@ -34,40 +38,39 @@ $menu-icon-spacing: 0.25rem !default;
34
38
  /// @type Color
35
39
  $menu-item-background-hover: $light-gray !default;
36
40
 
37
- /// Color for bordered menu
38
- /// @type Color
39
- $menu-border: $light-gray !default;
41
+ /// Backward compatibility for menu state. If true, this duplicate `active` with `is-active`.
42
+ /// But please note that `active` will be removed in upcoming versions.
43
+ /// @type Boolean
44
+ $menu-state-back-compat: true !default;
45
+
46
+ /// Backward compatibility for menu centered. If true, this duplicate `.menu-centered > .menu` with `.menu.align-center`.
47
+ /// But please note that `menu-centered` will be removed in upcoming versions.
48
+ /// @type Boolean
49
+ $menu-centered-back-compat: true !default;
40
50
 
41
51
  /// Creates the base styles for a Menu.
42
52
  @mixin menu-base {
43
- margin: $menu-margin;
44
- list-style-type: none;
53
+ padding: 0;
54
+ margin: 0;
55
+ list-style: none;
56
+ position: relative;
45
57
 
46
58
  @if $global-flexbox {
47
59
  display: flex;
48
- flex-wrap: nowrap;
49
- align-items: center;
50
- width: 100%;
60
+ flex-wrap: wrap;
51
61
  }
52
62
 
53
- // List items are table cell to allow for vertical alignment
54
- > li {
63
+ li {
55
64
  @include disable-mouse-outline;
56
-
57
- @if $global-flexbox {
58
- flex: 0 0 auto;
59
- }
60
- @else {
61
- display: table-cell;
62
- vertical-align: middle;
63
- }
64
65
  }
65
66
 
66
- // Reset line height to make the height of the overall item easier to calculate
67
- > li > a {
68
- display: block;
69
- padding: $menu-item-padding;
67
+ a,
68
+ .button {
70
69
  line-height: 1;
70
+ text-decoration: none;
71
+ white-space: nowrap;
72
+ display: block;
73
+ padding: $menu-items-padding;
71
74
  }
72
75
 
73
76
  // Reset styles of inner elements
@@ -77,59 +80,116 @@ $menu-border: $light-gray !default;
77
80
  button {
78
81
  margin-bottom: 0;
79
82
  }
83
+
84
+ input {
85
+ display: inline-block;
86
+ }
80
87
  }
81
88
 
82
89
  /// Expands the items of a Menu, so each item is the same width.
83
90
  @mixin menu-expand {
84
91
  @if $global-flexbox {
85
- > li {
92
+ li {
86
93
  flex: 1 1 0px; // sass-lint:disable-line zero-unit
87
94
  }
88
95
  }
89
96
  @else {
90
97
  display: table;
91
98
  width: 100%;
92
- table-layout: fixed;
93
- }
94
99
 
95
- > li:first-child:last-child {
96
- width: 100%;
100
+ > li {
101
+ display: table-cell;
102
+ vertical-align: middle;
103
+ }
97
104
  }
98
105
  }
99
106
 
100
- /// Sets the direction of a Menu.
101
- /// @param {Keyword} $dir [horizontal] - Direction of the Menu. Can be `horizontal` or `vertical`.
102
- @mixin menu-direction($dir: horizontal) {
103
- @if $dir == horizontal {
107
+ /// Align menu items.
108
+ @mixin menu-align($alignment) {
109
+ @if $alignment == left {
104
110
  @if $global-flexbox {
105
- flex-wrap: nowrap;
111
+ justify-content: flex-start;
112
+ }
113
+ @else {
114
+ text-align: $global-left;
115
+ }
116
+ }
117
+ @else if $alignment == right {
118
+ @if $global-flexbox {
119
+ li {
120
+ display: flex;
121
+ justify-content: flex-end;
122
+
123
+ .submenu li {
124
+ justify-content: flex-start;
125
+ }
126
+ }
127
+
128
+ &.vertical li {
129
+ display: block;
130
+ text-align: $global-right;
106
131
 
107
- > li {
108
- flex: 0 0 auto;
132
+ .submenu li {
133
+ text-align: $global-right;
134
+ }
109
135
  }
110
136
  }
111
137
  @else {
112
- > li {
113
- display: table-cell;
138
+ text-align: $global-right;
139
+
140
+ .submenu li {
141
+ text-align: $global-left;
142
+ }
143
+
144
+ &.vertical {
145
+ .submenu li {
146
+ text-align: $global-right;
147
+ }
114
148
  }
115
149
  }
116
150
  }
117
- @else if $dir == vertical {
151
+ @else if $alignment == center {
118
152
  @if $global-flexbox {
119
- flex-wrap: wrap;
153
+ li {
154
+ display: flex;
155
+ justify-content: center;
120
156
 
121
- > li {
122
- flex: 0 0 100%;
123
- max-width: 100%;
157
+ .submenu li {
158
+ justify-content: flex-start;
159
+ }
124
160
  }
161
+ }
162
+ @else {
163
+ text-align: center;
125
164
 
126
- > li > a {
127
- justify-content: flex-start;
128
- align-items: flex-start;
165
+ .submenu li {
166
+ text-align: $global-left;
129
167
  }
130
168
  }
169
+ }
170
+ }
171
+
172
+ /// Sets the direction of a Menu.
173
+ /// @param {Keyword} $dir [horizontal] - Direction of the Menu. Can be `horizontal` or `vertical`.
174
+ @mixin menu-direction($dir: horizontal) {
175
+ @if $dir == horizontal {
176
+ @if $global-flexbox {
177
+ flex-wrap: wrap;
178
+ flex-direction: row;
179
+ }
131
180
  @else {
132
- > li {
181
+ li {
182
+ display: inline-block;
183
+ }
184
+ }
185
+ }
186
+ @else if $dir == vertical {
187
+ @if $global-flexbox {
188
+ flex-wrap: nowrap;
189
+ flex-direction: column;
190
+ }
191
+ @else {
192
+ li {
133
193
  display: block;
134
194
  }
135
195
  }
@@ -140,68 +200,81 @@ $menu-border: $light-gray !default;
140
200
  }
141
201
 
142
202
  /// Creates a simple Menu, which has no padding or hover state.
143
- /// @param {Keyword} $dir [$global-left] - Direction of the menu. Set to `null` to do not generate styles for direction.
144
- @mixin menu-simple($dir: $global-left) {
145
- li {
146
- display: inline-block;
147
- vertical-align: top;
148
- line-height: 1;
203
+ /// @param {Keyword} $dir [$global-left] - Direction of the menu. This effects the side of the `<li>` that receives the margin.
204
+ /// @param {Number} $margin [$menu-simple-margin] - The margin to apply to each `<li>`.
205
+ @mixin menu-simple($dir: $global-left, $margin: $menu-simple-margin) {
206
+ @if $global-flexbox {
207
+ align-items: center;
208
+ }
209
+
210
+ li + li {
211
+ margin-#{$dir}: $margin;
149
212
  }
150
213
 
151
214
  a {
152
215
  padding: 0;
153
216
  }
217
+ }
154
218
 
155
- @if $dir != null {
156
- @include menu-simple-direction($dir);
219
+ /// Adds styles for a nested Menu, by adding `margin-left` to the menu.
220
+ /// @param {Keyword|Number} $margin [$menu-nested-margin] - Length of the margin.
221
+ /// @param {Keyword} $nested-alignment [left] - Alignment of the nested class
222
+ @mixin menu-nested(
223
+ $margin: $menu-nested-margin,
224
+ $nested-alignment: left
225
+ ) {
226
+ @if $nested-alignment == right {
227
+ margin-#{$global-right}: $margin;
228
+ margin-#{$global-left}: 0;
229
+ }
230
+ @else {
231
+ margin-#{$global-right}: 0;
232
+ margin-#{$global-left}: $margin;
157
233
  }
158
- }
159
234
 
160
- /// Direction modifier for a simple Menu
161
- /// @param {Keyword} $dir [$global-left] - Direction of the menu
162
- @mixin menu-simple-direction($dir: $global-left) {
163
- $no-margin-dir: $dir;
164
- $margin-dir: direction-opposite($dir);
235
+ }
165
236
 
166
- li {
167
- margin-#{$no-margin-dir}: 0;
168
- margin-#{$margin-dir}: get-side($menu-item-padding, $margin-dir);
237
+ /// Adds basic styles for icons in menus.
238
+ @mixin menu-icons() {
239
+ @if $global-flexbox {
240
+ a {
241
+ display: flex;
242
+ }
169
243
  }
170
- }
244
+ @else {
245
+ img,
246
+ i,
247
+ svg {
248
+ vertical-align: middle;
171
249
 
172
- /// Adds styles for a nested Menu, by adding `margin-left` to the menu.
173
- /// @param {Keyword|Number} $padding [auto] - Length of the margin.
174
- @mixin menu-nested($margin: $menu-margin-nested) {
175
- margin-#{$global-left}: $margin;
250
+ + span {
251
+ vertical-align: middle;
252
+ }
253
+ }
254
+ }
176
255
  }
177
256
 
178
- /// Adds support for icons to Menu items.
179
- /// @param {Keyword} $position [side] - Positioning for icons. Can be `side` (left, or right on RTL) or `top`.
180
- /// @param {Boolean} $base [true] - Set to `false` to prevent the shared CSS between side- and top-aligned icons from being printed. Set this to `false` if you're calling the mixin multiple times on the same element.
181
- @mixin menu-icons($position: side, $base: true) {
182
- @if $base {
183
- @if $global-flexbox {
184
- > li > a {
185
- display: flex;
257
+ /// Adds position classes for icons within a menu.
258
+ @mixin menu-icon-position($position: left, $spacing: $menu-icon-spacing) {
259
+ @if $position == left {
260
+ li a {
261
+ @if $global-flexbox {
262
+ flex-flow: row nowrap;
186
263
  }
187
- }
188
- @else {
189
- > li > a {
190
- img,
191
- i,
192
- svg {
193
- vertical-align: middle;
194
-
195
- + span {
196
- vertical-align: middle;
197
- }
264
+
265
+ img,
266
+ i,
267
+ svg {
268
+ margin-#{$global-right}: $spacing;
269
+
270
+ @if not $global-flexbox {
271
+ display: inline-block;
198
272
  }
199
273
  }
200
274
  }
201
275
  }
202
-
203
- @if $position == side {
204
- > li > a {
276
+ @else if $position == right {
277
+ li a {
205
278
  @if $global-flexbox {
206
279
  flex-flow: row nowrap;
207
280
  }
@@ -209,7 +282,7 @@ $menu-border: $light-gray !default;
209
282
  img,
210
283
  i,
211
284
  svg {
212
- margin-#{$global-right}: $menu-icon-spacing;
285
+ margin-#{$global-left}: $spacing;
213
286
 
214
287
  @if not $global-flexbox {
215
288
  display: inline-block;
@@ -218,7 +291,7 @@ $menu-border: $light-gray !default;
218
291
  }
219
292
  }
220
293
  @else if $position == top {
221
- > li > a {
294
+ li a {
222
295
  @if $global-flexbox {
223
296
  flex-flow: column nowrap;
224
297
  }
@@ -231,11 +304,35 @@ $menu-border: $light-gray !default;
231
304
  svg {
232
305
  @if not $global-flexbox {
233
306
  display: block;
234
- margin: 0 auto $menu-icon-spacing;
307
+ margin: 0 auto $spacing;
235
308
  }
236
309
  @else {
237
310
  align-self: stretch;
238
- margin-bottom: $menu-icon-spacing;
311
+ margin-bottom: $spacing;
312
+ text-align: center;
313
+ }
314
+ }
315
+ }
316
+ }
317
+ @else if $position == bottom {
318
+ li a {
319
+ @if $global-flexbox {
320
+ flex-flow: column nowrap;
321
+ }
322
+ @else {
323
+ text-align: center;
324
+ }
325
+
326
+ img,
327
+ i,
328
+ svg {
329
+ @if not $global-flexbox {
330
+ display: block;
331
+ margin: $spacing auto 0;
332
+ }
333
+ @else {
334
+ align-self: stretch;
335
+ margin-bottom: $spacing;
239
336
  text-align: center;
240
337
  }
241
338
  }
@@ -244,127 +341,135 @@ $menu-border: $light-gray !default;
244
341
  }
245
342
 
246
343
  @mixin menu-text {
247
- padding-top: 0;
248
- padding-bottom: 0;
249
- padding: $menu-item-padding;
344
+ padding: $global-menu-padding;
250
345
 
251
346
  font-weight: bold;
252
347
  line-height: 1;
253
348
  color: inherit;
254
349
  }
255
350
 
351
+ @mixin menu-state-active {
352
+ background: $menu-item-background-active;
353
+ color: $menu-item-color-active;
354
+ }
355
+
256
356
  @mixin foundation-menu {
257
357
  .menu {
258
358
  @include menu-base;
259
- @include menu-icons;
260
359
 
261
360
  // Default orientation: horizontal
262
361
  &, &.horizontal {
263
362
  @include menu-direction(horizontal);
264
363
  }
265
364
 
365
+ // Vertical orientation modifier
366
+ &.vertical {
367
+ @include menu-direction(vertical);
368
+ }
369
+
266
370
  // Even-width modifier for horizontal orientation
267
371
  &.expanded {
268
372
  @include menu-expand;
269
373
  }
270
374
 
271
- // Vertical orientation modifier
272
- &.vertical {
273
- @include menu-direction(vertical);
375
+ // Simple
376
+ &.simple {
377
+ @include menu-simple;
274
378
  }
275
379
 
380
+ // Breakpoint specific versions
276
381
  @include -zf-each-breakpoint($small: false) {
277
382
  &.#{$-zf-size}-horizontal {
278
383
  @include menu-direction(horizontal);
279
384
  }
280
385
 
386
+ &.#{$-zf-size}-vertical {
387
+ @include menu-direction(vertical);
388
+ }
389
+
281
390
  &.#{$-zf-size}-expanded {
282
391
  @include menu-expand;
283
392
  }
284
393
 
285
- &.#{$-zf-size}-vertical {
286
- @include menu-direction(vertical);
394
+ &.#{$-zf-size}-simple {
395
+ @include menu-expand;
287
396
  }
288
397
  }
289
398
 
290
- // Simple
291
- &.simple {
292
- @include menu-simple;
399
+ // Nesting
400
+ &.nested {
401
+ @include menu-nested;
402
+ }
293
403
 
294
- &.align-#{$global-right} {
295
- @include menu-simple-direction($global-right);
296
- }
404
+ // Icon Base Styles
405
+ &.icons {
406
+ @include menu-icons;
297
407
  }
298
408
 
299
- // Align right
300
- &.align-#{$global-right} {
301
- @if $global-flexbox {
302
- justify-content: flex-end;
303
- }
304
- @else {
305
- @include clearfix;
409
+ // Icon Left
410
+ &.icon-left {
411
+ @include menu-icon-position(left);
412
+ }
306
413
 
307
- > li {
308
- float: $global-right;
309
- }
310
- }
414
+ // Icon Right
415
+ &.icon-right {
416
+ @include menu-icon-position(right);
311
417
  }
312
418
 
313
- // Vertical icons
419
+ // Icon Top
314
420
  &.icon-top {
315
- @include menu-icons(top, $base: false);
316
- // Make vertical menu with icons on top work
317
- &.vertical {
318
- a > span {
319
- margin: auto;
320
- }
321
- }
421
+ @include menu-icon-position(top);
322
422
  }
323
423
 
324
- // Nesting
325
- &.nested {
326
- @include menu-nested;
424
+ // Icon Bottom
425
+ &.icon-bottom {
426
+ @include menu-icon-position(bottom);
327
427
  }
328
428
 
329
429
  // Active state
330
- .active > a {
331
- background: $menu-item-background-active;
332
- color: $menu-item-color-active;
430
+ .is-active > a {
431
+ @include menu-state-active;
333
432
  }
334
-
335
- // Menu with border
336
- &.menu-bordered {
337
- li {
338
- border: 1px solid $menu-border;
339
- &:not(:first-child) {
340
- border-top: 0;
341
- }
433
+
434
+ // Backward Compatibility for active state
435
+ @if $menu-state-back-compat {
436
+ .active > a {
437
+ @include menu-state-active;
342
438
  }
343
439
  }
344
440
 
345
- // Menu with background hover
346
- &.menu-hover {
347
- li:hover {
348
- background-color: $menu-item-background-hover;
441
+ // Align left
442
+ &.align-#{$global-left} {
443
+ @include menu-align(left);
444
+ }
445
+
446
+ // Align right
447
+ &.align-#{$global-right} {
448
+ @include menu-align(right);
449
+
450
+ .nested {
451
+ @include menu-nested($nested-alignment: right);
349
452
  }
350
453
  }
351
- }
352
454
 
353
- .menu-text {
354
- @include menu-text;
355
- }
455
+ // Align center
456
+ &.align-center {
457
+ @include menu-align(center);
458
+ }
356
459
 
357
- // Align center
358
- .menu-centered {
359
- text-align: center;
460
+ .menu-text {
461
+ @include menu-text;
462
+ }
463
+ }
360
464
 
361
- > .menu {
362
- @if $global-flexbox {
363
- @include flex-align($x: center, $y: top);
364
- }
365
- @else {
366
- display: inline-block;
367
- vertical-align: top;
465
+ @if $menu-centered-back-compat {
466
+ .menu-centered {
467
+ > .menu {
468
+ @if $global-flexbox {
469
+ justify-content: center;
470
+ }
471
+
472
+ @include menu-align(center);
368
473
  }
369
474
  }
370
475
  }