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
@@ -17,8 +17,8 @@
17
17
 
18
18
  .float-center {
19
19
  display: block;
20
- margin-left: auto;
21
20
  margin-right: auto;
21
+ margin-left: auto;
22
22
  }
23
23
 
24
24
  .clearfix {
@@ -12,7 +12,15 @@ $label-background: $primary-color !default;
12
12
 
13
13
  /// Default text color for labels.
14
14
  /// @type Color
15
- $label-color: foreground($label-background) !default;
15
+ $label-color: $white !default;
16
+
17
+ /// Alternate text color for labels.
18
+ /// @type Color
19
+ $label-color-alt: $black !default;
20
+
21
+ /// Coloring classes. A map of classes to output in your CSS, like `.secondary`, `.success`, and so on.
22
+ /// @type Map
23
+ $label-palette: $foundation-palette !default;
16
24
 
17
25
  /// Default font size for labels.
18
26
  /// @type Number
@@ -30,11 +38,13 @@ $label-radius: $global-radius !default;
30
38
  @mixin label {
31
39
  display: inline-block;
32
40
  padding: $label-padding;
41
+
42
+ border-radius: $label-radius;
43
+
33
44
  font-size: $label-font-size;
34
45
  line-height: 1;
35
46
  white-space: nowrap;
36
47
  cursor: default;
37
- border-radius: $label-radius;
38
48
  }
39
49
 
40
50
  @mixin foundation-label {
@@ -44,12 +54,10 @@ $label-radius: $global-radius !default;
44
54
  background: $label-background;
45
55
  color: $label-color;
46
56
 
47
- @each $name, $color in $foundation-colors {
48
- @if $name != primary {
49
- &.#{$name} {
50
- background: $color;
51
- color: foreground($color);
52
- }
57
+ @each $name, $color in $label-palette {
58
+ &.#{$name} {
59
+ background: $color;
60
+ color: color-pick-contrast($color, ($label-color, $label-color-alt));
53
61
  }
54
62
  }
55
63
  }
@@ -14,37 +14,57 @@ $mediaobject-margin-bottom: $global-margin !default;
14
14
  /// @type Number
15
15
  $mediaobject-section-padding: $global-padding !default;
16
16
 
17
- /// With of images within a media object, when the object is stacked vertically. Set to 'auto' to use the image's natural width.
17
+ /// Width of images within a media object, when the object is stacked vertically. Set to 'auto' to use the image's natural width.
18
18
  /// @type Number
19
19
  $mediaobject-image-width-stacked: 100% !default;
20
20
 
21
21
  /// Adds styles for a media object container.
22
22
  @mixin media-object-container {
23
+ display: if($global-flexbox, flex, block);
23
24
  margin-bottom: $mediaobject-margin-bottom;
24
- display: block;
25
+
26
+ @if $global-flexbox {
27
+ flex-wrap: nowrap;
28
+ }
25
29
  }
26
30
 
27
31
  /// Adds styles for sections within a media object.
28
32
  /// @param {Number} $padding [$mediaobject-section-padding] - Padding between sections.
29
33
  @mixin media-object-section($padding: $mediaobject-section-padding) {
30
- display: table-cell;
31
- vertical-align: top;
34
+ @if $global-flexbox {
35
+ flex: 0 1 auto;
36
+ }
37
+ @else {
38
+ display: table-cell;
39
+ vertical-align: top;
40
+ }
32
41
 
33
42
  &:first-child {
34
43
  padding-#{$global-right}: $padding;
35
44
  }
36
45
 
37
- &:last-child:not(+ &:first-child) {
46
+ &:last-child:not(:nth-child(2)) {
38
47
  padding-#{$global-left}: $padding;
39
48
  }
49
+
50
+ > :last-child {
51
+ margin-bottom: 0;
52
+ }
40
53
  }
41
54
 
42
55
  /// Adds styles to stack sections of a media object. Apply this to the section elements, not the container.
43
56
  @mixin media-object-stack {
44
- display: block;
45
57
  padding: 0;
46
58
  padding-bottom: $mediaobject-section-padding;
47
59
 
60
+ @if $global-flexbox {
61
+ flex-basis: 100%;
62
+ max-width: 100%;
63
+ }
64
+ @else {
65
+ display: block;
66
+ }
67
+
48
68
  img {
49
69
  width: $mediaobject-image-width-stacked;
50
70
  }
@@ -58,8 +78,16 @@ $mediaobject-image-width-stacked: 100% !default;
58
78
  max-width: none;
59
79
  }
60
80
 
61
- &.stack-for-small .media-object-section {
62
- @include breakpoint(small only) {
81
+ @if $global-flexbox {
82
+ &.stack-for-#{$-zf-zero-breakpoint} {
83
+ @include breakpoint($-zf-zero-breakpoint only) {
84
+ flex-wrap: wrap;
85
+ }
86
+ }
87
+ }
88
+
89
+ &.stack-for-#{$-zf-zero-breakpoint} .media-object-section {
90
+ @include breakpoint($-zf-zero-breakpoint only) {
63
91
  @include media-object-stack;
64
92
  }
65
93
  }
@@ -68,7 +96,19 @@ $mediaobject-image-width-stacked: 100% !default;
68
96
  .media-object-section {
69
97
  @include media-object-section;
70
98
 
71
- &.middle { vertical-align: middle; }
72
- &.bottom { vertical-align: bottom; }
99
+ @if $global-flexbox {
100
+ &.main-section {
101
+ flex: 1 1 0px; // sass-lint:disable-line zero-unit
102
+ }
103
+ }
104
+ @else {
105
+ &.middle {
106
+ vertical-align: middle;
107
+ }
108
+
109
+ &.bottom {
110
+ vertical-align: bottom;
111
+ }
112
+ }
73
113
  }
74
114
  }
@@ -0,0 +1,9 @@
1
+ @mixin foundation-menu-icon {
2
+ .menu-icon {
3
+ @include hamburger($color: $titlebar-icon-color, $color-hover: $titlebar-icon-color-hover);
4
+ }
5
+
6
+ .menu-icon.dark {
7
+ @include hamburger;
8
+ }
9
+ }
@@ -12,59 +12,163 @@ $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;
24
+
25
+ /// Text color of an active menu item.
26
+ /// @type Color
27
+ $menu-item-color-active: $white !default;
28
+
29
+ /// Background color of an active menu item.
30
+ /// @type Color
31
+ $menu-item-background-active: get-color(primary) !default;
20
32
 
21
33
  /// Spacing between an icon and text in a menu item.
22
34
  /// @type Number
23
35
  $menu-icon-spacing: 0.25rem !default;
24
36
 
25
- /// Maximum number of `expand-n` classes to include in the CSS.
26
- /// @type Number
27
- $menu-expand-max: 6 !default;
37
+ /// Background color for an hovered menu item.
38
+ /// @type Color
39
+ $menu-item-background-hover: $light-gray !default;
40
+
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;
50
+
51
+ /// Backward compatibility for using `icon-*` classes without `.icons` classes
52
+ /// But please note that this backward compatibility will be removed in upcoming versions.
53
+ /// @type Boolean
54
+ $menu-icons-back-compat: true !default;
28
55
 
29
56
  /// Creates the base styles for a Menu.
30
57
  @mixin menu-base {
31
- margin: $menu-margin;
32
- list-style-type: none;
58
+ padding: 0;
59
+ margin: 0;
60
+ list-style: none;
61
+ position: relative;
62
+
63
+ @if $global-flexbox {
64
+ display: flex;
65
+ flex-wrap: wrap;
66
+ }
33
67
 
34
- // List items are table cell to allow for vertical alignment
35
- > li {
68
+ li {
36
69
  @include disable-mouse-outline;
37
- display: table-cell;
38
- vertical-align: middle;
39
70
  }
40
71
 
41
- // Reset line height to make the height of the overall item easier to calculate
42
- > li > a {
43
- display: block;
44
- padding: $menu-item-padding;
72
+ a,
73
+ .button {
45
74
  line-height: 1;
75
+ text-decoration: none;
76
+ display: block;
77
+ padding: $menu-items-padding;
46
78
  }
47
79
 
48
80
  // Reset styles of inner elements
49
81
  input,
82
+ select,
50
83
  a,
51
84
  button {
52
85
  margin-bottom: 0;
53
86
  }
87
+
88
+ input {
89
+ display: inline-block;
90
+ }
54
91
  }
55
92
 
56
93
  /// Expands the items of a Menu, so each item is the same width.
57
- /// @param {Keyword|Number} $count [auto] - Number of items in the Menu. You can hardcode a number, or use `auto` to generate CSS that will adapt to the number of items inside the menu.
58
- @mixin menu-expand($count: auto) {
59
- display: table;
60
- width: 100%;
94
+ @mixin menu-expand {
95
+ @if $global-flexbox {
96
+ li {
97
+ flex: 1 1 0px; // sass-lint:disable-line zero-unit
98
+ }
99
+ }
100
+ @else {
101
+ display: table;
102
+ width: 100%;
103
+
104
+ > li {
105
+ display: table-cell;
106
+ vertical-align: middle;
107
+ }
108
+ }
109
+ }
110
+
111
+ /// Align menu items.
112
+ @mixin menu-align($alignment) {
113
+ @if $alignment == left {
114
+ @if $global-flexbox {
115
+ justify-content: flex-start;
116
+ }
117
+ @else {
118
+ text-align: $global-left;
119
+ }
120
+ }
121
+ @else if $alignment == right {
122
+ @if $global-flexbox {
123
+ li {
124
+ display: flex;
125
+ justify-content: flex-end;
126
+
127
+ .submenu li {
128
+ justify-content: flex-start;
129
+ }
130
+ }
131
+
132
+ &.vertical li {
133
+ display: block;
134
+ text-align: $global-right;
135
+
136
+ .submenu li {
137
+ text-align: $global-right;
138
+ }
139
+ }
140
+ }
141
+ @else {
142
+ text-align: $global-right;
143
+
144
+ .submenu li {
145
+ text-align: $global-left;
146
+ }
61
147
 
62
- > li {
63
- @if $count == auto {
64
- @include auto-width($menu-expand-max);
148
+ &.vertical {
149
+ .submenu li {
150
+ text-align: $global-right;
151
+ }
152
+ }
153
+ }
154
+ }
155
+ @else if $alignment == center {
156
+ @if $global-flexbox {
157
+ li {
158
+ display: flex;
159
+ justify-content: center;
160
+
161
+ .submenu li {
162
+ justify-content: flex-start;
163
+ }
164
+ }
65
165
  }
66
- @else if type-of($count) == 'number' {
67
- width: percentage(1 / $count);
166
+ @else {
167
+ text-align: center;
168
+
169
+ .submenu li {
170
+ text-align: $global-left;
171
+ }
68
172
  }
69
173
  }
70
174
  }
@@ -73,13 +177,25 @@ $menu-expand-max: 6 !default;
73
177
  /// @param {Keyword} $dir [horizontal] - Direction of the Menu. Can be `horizontal` or `vertical`.
74
178
  @mixin menu-direction($dir: horizontal) {
75
179
  @if $dir == horizontal {
76
- > li {
77
- display: table-cell;
180
+ @if $global-flexbox {
181
+ flex-wrap: wrap;
182
+ flex-direction: row;
183
+ }
184
+ @else {
185
+ li {
186
+ display: inline-block;
187
+ }
78
188
  }
79
189
  }
80
190
  @else if $dir == vertical {
81
- > li {
82
- display: block;
191
+ @if $global-flexbox {
192
+ flex-wrap: nowrap;
193
+ flex-direction: column;
194
+ }
195
+ @else {
196
+ li {
197
+ display: block;
198
+ }
83
199
  }
84
200
  }
85
201
  @else {
@@ -88,91 +204,176 @@ $menu-expand-max: 6 !default;
88
204
  }
89
205
 
90
206
  /// Creates a simple Menu, which has no padding or hover state.
91
- @mixin menu-simple {
207
+ /// @param {Keyword} $dir [$global-left] - Direction of the menu. This effects the side of the `<li>` that receives the margin.
208
+ /// @param {Number} $margin [$menu-simple-margin] - The margin to apply to each `<li>`.
209
+ @mixin menu-simple($dir: $global-left, $margin: $menu-simple-margin) {
210
+ @if $global-flexbox {
211
+ align-items: center;
212
+ }
213
+
214
+ li + li {
215
+ margin-#{$dir}: $margin;
216
+ }
217
+
92
218
  a {
93
219
  padding: 0;
94
- margin-#{$global-right}: get-side($menu-item-padding, $global-right);
95
220
  }
96
221
  }
97
222
 
98
223
  /// Adds styles for a nested Menu, by adding `margin-left` to the menu.
99
- /// @param {Keyword|Number} $padding [auto] - Length of the margin.
100
- @mixin menu-nested($margin: $menu-margin-nested) {
101
- margin-#{$global-left}: $margin;
224
+ /// @param {Keyword|Number} $margin [$menu-nested-margin] - Length of the margin.
225
+ /// @param {Keyword} $nested-alignment [left] - Alignment of the nested class
226
+ @mixin menu-nested(
227
+ $margin: $menu-nested-margin,
228
+ $nested-alignment: left
229
+ ) {
230
+ @if $nested-alignment == right {
231
+ margin-#{$global-right}: $margin;
232
+ margin-#{$global-left}: 0;
233
+ }
234
+ @else {
235
+ margin-#{$global-right}: 0;
236
+ margin-#{$global-left}: $margin;
237
+ }
238
+
102
239
  }
103
240
 
104
- /// Adds support for icons to Menu items.
105
- /// @param {Keyword} $position [side] - Positioning for icons. Can be `side` (left, or right on RTL) or `top`.
106
- /// @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.
107
- @mixin menu-icons($position: side, $base: true) {
108
- @if $base {
109
- > li > a {
110
- > img,
111
- > i {
241
+ /// Adds basic styles for icons in menus.
242
+ @mixin menu-icons() {
243
+ @if $global-flexbox {
244
+ a {
245
+ display: flex;
246
+ }
247
+ }
248
+ @else {
249
+ img,
250
+ i,
251
+ svg {
252
+ vertical-align: middle;
253
+
254
+ + span {
112
255
  vertical-align: middle;
113
256
  }
257
+ }
258
+ }
259
+ }
114
260
 
115
- > span {
116
- vertical-align: middle;
261
+ /// Adds position classes for icons within a menu.
262
+ @mixin menu-icon-position($position: left, $spacing: $menu-icon-spacing) {
263
+ @if $position == left {
264
+ li a {
265
+ @if $global-flexbox {
266
+ flex-flow: row nowrap;
267
+ }
268
+
269
+ img,
270
+ i,
271
+ svg {
272
+ margin-#{$global-right}: $spacing;
273
+
274
+ @if not $global-flexbox {
275
+ display: inline-block;
276
+ }
117
277
  }
118
278
  }
119
279
  }
280
+ @else if $position == right {
281
+ li a {
282
+ @if $global-flexbox {
283
+ flex-flow: row nowrap;
284
+ }
120
285
 
121
- @if $position == side {
122
- > li > a {
123
- > img,
124
- > i {
125
- display: inline-block;
126
- margin-#{$global-right}: $menu-icon-spacing;
286
+ img,
287
+ i,
288
+ svg {
289
+ margin-#{$global-left}: $spacing;
290
+
291
+ @if not $global-flexbox {
292
+ display: inline-block;
293
+ }
127
294
  }
128
295
  }
129
296
  }
130
297
  @else if $position == top {
131
- > li > a {
132
- text-align: center;
298
+ li a {
299
+ @if $global-flexbox {
300
+ flex-flow: column nowrap;
301
+ }
302
+ @else {
303
+ text-align: center;
304
+ }
133
305
 
134
- > img,
135
- > i {
136
- display: block;
137
- margin: 0 auto $menu-icon-spacing;
306
+ img,
307
+ i,
308
+ svg {
309
+ @if not $global-flexbox {
310
+ display: block;
311
+ margin: 0 auto $spacing;
312
+ }
313
+ @else {
314
+ align-self: stretch;
315
+ margin-bottom: $spacing;
316
+ text-align: center;
317
+ }
318
+ }
319
+ }
320
+ }
321
+ @else if $position == bottom {
322
+ li a {
323
+ @if $global-flexbox {
324
+ flex-flow: column nowrap;
325
+ }
326
+ @else {
327
+ text-align: center;
328
+ }
329
+
330
+ img,
331
+ i,
332
+ svg {
333
+ @if not $global-flexbox {
334
+ display: block;
335
+ margin: $spacing auto 0;
336
+ }
337
+ @else {
338
+ align-self: stretch;
339
+ margin-bottom: $spacing;
340
+ text-align: center;
341
+ }
138
342
  }
139
343
  }
140
344
  }
141
345
  }
142
346
 
143
347
  @mixin menu-text {
348
+ padding: $global-menu-padding;
349
+
144
350
  font-weight: bold;
145
- color: inherit;
146
351
  line-height: 1;
147
- padding-top: 0;
148
- padding-bottom: 0;
149
- padding: $menu-item-padding;
352
+ color: inherit;
353
+ }
354
+
355
+ @mixin menu-state-active {
356
+ background: $menu-item-background-active;
357
+ color: $menu-item-color-active;
150
358
  }
151
359
 
152
360
  @mixin foundation-menu {
153
361
  .menu {
154
362
  @include menu-base;
155
- @include menu-icons;
156
363
 
157
- // Orientation
158
- @include menu-direction(horizontal);
364
+ // Default orientation: horizontal
365
+ &, &.horizontal {
366
+ @include menu-direction(horizontal);
367
+ }
159
368
 
369
+ // Vertical orientation modifier
160
370
  &.vertical {
161
371
  @include menu-direction(vertical);
162
372
  }
163
373
 
164
- @each $size in $breakpoint-classes {
165
- @if $size != small {
166
- @include breakpoint($size) {
167
- &.#{$size}-horizontal {
168
- @include menu-direction(horizontal);
169
- }
170
-
171
- &.#{$size}-vertical {
172
- @include menu-direction(vertical);
173
- }
174
- }
175
- }
374
+ // Even-width modifier for horizontal orientation
375
+ &.expanded {
376
+ @include menu-expand;
176
377
  }
177
378
 
178
379
  // Simple
@@ -180,34 +381,115 @@ $menu-expand-max: 6 !default;
180
381
  @include menu-simple;
181
382
  }
182
383
 
183
- // Align right
184
- &.align-#{$global-right} {
185
- > li {
186
- float: $global-right;
384
+ // Breakpoint specific versions
385
+ @include -zf-each-breakpoint($small: false) {
386
+ &.#{$-zf-size}-horizontal {
387
+ @include menu-direction(horizontal);
187
388
  }
188
- }
189
389
 
190
- // Even-width
191
- &.expanded {
192
- @include menu-expand;
390
+ &.#{$-zf-size}-vertical {
391
+ @include menu-direction(vertical);
392
+ }
193
393
 
194
- > li:first-child:last-child {
195
- width: 100%;
394
+ &.#{$-zf-size}-expanded {
395
+ @include menu-expand;
196
396
  }
197
- }
198
397
 
199
- // Vertical icons
200
- &.icon-top {
201
- @include menu-icons(top, $base: false);
398
+ &.#{$-zf-size}-simple {
399
+ @include menu-expand;
400
+ }
202
401
  }
203
402
 
204
403
  // Nesting
205
404
  &.nested {
206
405
  @include menu-nested;
207
406
  }
407
+
408
+ // Icon Base Styles
409
+ &.icons {
410
+ @include menu-icons;
411
+ }
412
+
413
+ // Backward Compatibility for active state
414
+ @if $menu-icons-back-compat {
415
+ &.icon-top,
416
+ &.icon-right,
417
+ &.icon-bottom,
418
+ &.icon-left {
419
+ @include menu-icons;
420
+ }
421
+ }
422
+
423
+ // Icon Left
424
+ &.icon-left {
425
+ @include menu-icon-position(left);
426
+ }
427
+
428
+ // Icon Right
429
+ &.icon-right {
430
+ @include menu-icon-position(right);
431
+ }
432
+
433
+ // Icon Top
434
+ &.icon-top {
435
+ @include menu-icon-position(top);
436
+ }
437
+
438
+ // Icon Bottom
439
+ &.icon-bottom {
440
+ @include menu-icon-position(bottom);
441
+ }
442
+
443
+ // Active state
444
+ .is-active > a {
445
+ @include menu-state-active;
446
+ }
447
+
448
+ // Backward Compatibility for active state
449
+ @if $menu-state-back-compat {
450
+ .active > a {
451
+ @include menu-state-active;
452
+ }
453
+ }
454
+
455
+ // Align left
456
+ &.align-#{$global-left} {
457
+ @include menu-align(left);
458
+ }
459
+
460
+ // Align right
461
+ &.align-#{$global-right} {
462
+ @include menu-align(right);
463
+
464
+ .nested {
465
+ @include menu-nested($nested-alignment: right);
466
+ }
467
+ }
468
+
469
+ // Align center
470
+ &.align-center {
471
+ @include menu-align(center);
472
+ }
473
+
474
+ .menu-text {
475
+ @include menu-text;
476
+ }
477
+ }
478
+
479
+ @if $menu-centered-back-compat {
480
+ .menu-centered {
481
+ > .menu {
482
+ @if $global-flexbox {
483
+ justify-content: center;
484
+ }
485
+
486
+ @include menu-align(center);
487
+ }
488
+ }
208
489
  }
209
490
 
210
- .menu-text {
211
- @include menu-text;
491
+ // Prevent FOUC when using the Responsive Menu plugin
492
+ .no-js [data-responsive-menu] ul {
493
+ display: none;
212
494
  }
213
495
  }