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
@@ -12,7 +12,15 @@ $badge-background: $primary-color !default;
12
12
 
13
13
  /// Default text color for badges.
14
14
  /// @type Color
15
- $badge-color: foreground($badge-background) !default;
15
+ $badge-color: $white !default;
16
+
17
+ /// Alternate text color for badges.
18
+ /// @type Color
19
+ $badge-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
+ $badge-palette: $foundation-palette !default;
16
24
 
17
25
  /// Default padding inside badges.
18
26
  /// @type Number
@@ -29,11 +37,13 @@ $badge-font-size: 0.6rem !default;
29
37
  /// Generates the base styles for a badge.
30
38
  @mixin badge {
31
39
  display: inline-block;
32
- padding: $badge-padding;
33
40
  min-width: $badge-minwidth;
41
+ padding: $badge-padding;
42
+
43
+ border-radius: 50%;
44
+
34
45
  font-size: $badge-font-size;
35
46
  text-align: center;
36
- border-radius: 50%;
37
47
  }
38
48
 
39
49
  @mixin foundation-badge {
@@ -43,12 +53,10 @@ $badge-font-size: 0.6rem !default;
43
53
  background: $badge-background;
44
54
  color: $badge-color;
45
55
 
46
- @each $name, $color in $foundation-colors {
47
- @if $name != primary {
48
- &.#{$name} {
49
- background: $color;
50
- color: foreground($color);
51
- }
56
+ @each $name, $color in $badge-palette {
57
+ &.#{$name} {
58
+ background: $color;
59
+ color: color-pick-contrast($color, ($badge-color, $badge-color-alt));
52
60
  }
53
61
  }
54
62
  }
@@ -34,38 +34,60 @@ $breadcrumbs-item-margin: 0.75rem !default;
34
34
  /// @type Boolean
35
35
  $breadcrumbs-item-uppercase: true !default;
36
36
 
37
- /// If `true`, adds a slash between breadcrumb links.
37
+ /// If `true`, adds a seperator between breadcrumb links.
38
38
  /// @type Boolean
39
- $breadcrumbs-item-slash: true !default;
39
+ $breadcrumbs-item-separator: true !default;
40
+
41
+ // If it exists $breadcrumbs-item-slash is used to build $breadcrumbs-item-separator. See the documentation.
42
+ @if variable-exists(breadcrumbs-item-slash) {
43
+ $breadcrumbs-item-separator: $breadcrumbs-item-slash;
44
+ }
45
+
46
+ /// Used character for the breadcrumb separator.
47
+ /// @type Content
48
+ $breadcrumbs-item-separator-item: '/' !default;
49
+
50
+ /// Used character for the breadcrumb separator in rtl mode.
51
+ /// @type Content
52
+ $breadcrumbs-item-separator-item-rtl: '\\' !default;
53
+
54
+ /// Color of breadcrumb item.
55
+ /// @type Color
56
+ $breadcrumbs-item-separator-color: $medium-gray !default;
57
+
58
+ // If it exists $breadcrumbs-item-slash-color is used to build $breadcrumbs-item-separator-color. See the documentation.
59
+ @if variable-exists(breadcrumbs-item-slash-color) {
60
+ $breadcrumbs-item-separator-color: $breadcrumbs-item-slash-color;
61
+ }
40
62
 
41
63
  /// Adds styles for a breadcrumbs container, along with the styles for the `<li>` and `<a>` elements inside of it.
42
64
  @mixin breadcrumbs-container {
43
65
  @include clearfix;
44
- list-style: none;
45
66
  margin: $breadcrumbs-margin;
67
+ list-style: none;
46
68
 
47
69
  // Item wrapper
48
70
  li {
49
71
  float: #{$global-left};
50
- color: $breadcrumbs-item-color-current;
72
+
51
73
  font-size: $breadcrumbs-item-font-size;
74
+ color: $breadcrumbs-item-color-current;
52
75
  cursor: default;
53
76
 
54
77
  @if $breadcrumbs-item-uppercase {
55
78
  text-transform: uppercase;
56
79
  }
57
80
 
58
- @if $breadcrumbs-item-slash {
81
+ @if $breadcrumbs-item-separator {
59
82
  // Need to escape the backslash
60
- $slash: if($global-text-direction == 'ltr', '/', '\\');
83
+ $separator: if($global-text-direction == 'ltr', $breadcrumbs-item-separator-item, $breadcrumbs-item-separator-item-rtl);
61
84
 
62
85
  &:not(:last-child)::after {
63
- color: $medium-gray;
64
- content: $slash;
65
- margin: 0 $breadcrumbs-item-margin;
66
86
  position: relative;
67
- top: 1px;
87
+ margin: 0 $breadcrumbs-item-margin;
68
88
  opacity: 1;
89
+ content: $separator;
90
+ color: $breadcrumbs-item-separator-color;
69
91
  }
70
92
  }
71
93
  @else {
@@ -89,6 +111,7 @@ $breadcrumbs-item-slash: true !default;
89
111
 
90
112
  .disabled {
91
113
  color: $breadcrumbs-item-color-disabled;
114
+ cursor: not-allowed;
92
115
  }
93
116
  }
94
117
  }
@@ -8,53 +8,115 @@
8
8
 
9
9
  /// Margin for button groups.
10
10
  /// @type Number
11
- $buttongroup-margin: 1rem;
11
+ $buttongroup-margin: 1rem !default;
12
12
 
13
13
  /// Margin between buttons in a button group.
14
- /// @type Border
15
- $buttongroup-spacing: 1px;
14
+ /// @type Number
15
+ $buttongroup-spacing: 1px !default;
16
16
 
17
17
  /// Selector for the buttons inside a button group.
18
18
  /// @type String
19
- $buttongroup-child-selector: '.button';
19
+ $buttongroup-child-selector: '.button' !default;
20
20
 
21
21
  /// Maximum number of buttons that can be in an even-width button group.
22
22
  /// @type Number
23
- $buttongroup-expand-max: 6;
23
+ $buttongroup-expand-max: 6 !default;
24
+
25
+ /// Determines if $button-radius is applied to each button or the button group as a whole. Use $global-radius in _settings.scss to change radius.
26
+ /// @type Boolean
27
+ $buttongroup-radius-on-each: true !default;
24
28
 
25
29
  /// Add styles for a button group container.
26
30
  /// @param {String} $child-selector [$buttongroup-child-selector] - Selector for the buttons inside a button group.
31
+ /// @param {Number} $spacing [$buttongroup-spacing] - Spacing between buttons in a button group.
27
32
  @mixin button-group(
28
- $child-selector: $buttongroup-child-selector
33
+ $child-selector: $buttongroup-child-selector,
34
+ $spacing: $buttongroup-spacing
29
35
  ) {
30
36
  @include clearfix;
31
37
  margin-bottom: $buttongroup-margin;
32
- font-size: map-get($button-sizes, default);
38
+
39
+ @if $global-flexbox {
40
+ display: flex;
41
+ flex-wrap: nowrap;
42
+ align-items: stretch;
43
+ }
44
+ @else {
45
+ font-size: 0;
46
+ }
33
47
 
34
48
  #{$child-selector} {
35
- float: #{$global-left};
36
49
  margin: 0;
37
- font-size: inherit;
50
+ margin-#{$global-right}: $spacing;
51
+ margin-bottom: $spacing;
52
+ font-size: map-get($button-sizes, default);
53
+
54
+ @if $global-flexbox {
55
+ flex: 0 0 auto;
56
+ }
38
57
 
39
- &:not(:last-child) {
40
- border-#{$global-right}: $buttongroup-spacing solid $body-background;
58
+ &:last-child {
59
+ margin-#{$global-right}: 0;
41
60
  }
61
+
62
+ @if not $buttongroup-radius-on-each {
63
+ border-radius: 0;
64
+
65
+ &:first-child {
66
+ border-top-#{$global-left}-radius: $button-radius;
67
+ border-bottom-#{$global-left}-radius: $button-radius;
68
+ }
69
+
70
+ &:last-child {
71
+ border-top-#{$global-right}-radius: $button-radius;
72
+ border-bottom-#{$global-right}-radius: $button-radius;
73
+ }
74
+ }
75
+
42
76
  }
43
77
  }
44
78
 
45
79
  /// Creates a full-width button group, making each button equal width.
46
- /// @param {Keyword|Number} $count [auto] - Number of buttons inside the button group. Set to `auto` to generate CSS that will account for a variable number of buttons.
47
80
  /// @param {String} $selector [$buttongroup-child-selector] - Selector for the buttons inside a button group.
81
+ /// @param {Number} $spacing [$buttongroup-spacing] - Spacing between buttons in a button group.
48
82
  @mixin button-group-expand(
49
- $count: auto,
50
- $selector: $buttongroup-child-selector
83
+ $selector: $buttongroup-child-selector,
84
+ $spacing: $buttongroup-spacing,
85
+ $count: null
51
86
  ) {
87
+ @if not $global-flexbox {
88
+ margin-#{$global-right}: -$spacing;
89
+
90
+ &::before,
91
+ &::after {
92
+ display: none;
93
+ }
94
+ }
95
+
52
96
  #{$selector} {
53
- @if $count == auto {
54
- @include auto-width($buttongroup-expand-max, $selector);
97
+ @if $global-flexbox {
98
+ flex: 1 1 0px; // sass-lint:disable-line zero-unit
55
99
  }
56
- @else if type-of($count) == 'number' {
57
- width: percentage(1 / $count);
100
+ @else {
101
+ // One child
102
+ &:first-child:last-child {
103
+ width: 100%;
104
+ }
105
+
106
+ // Two or more childreen
107
+ @for $i from 2 through $buttongroup-expand-max {
108
+ &:first-child:nth-last-child(#{$i}) {
109
+ &, &:first-child:nth-last-child(#{$i}) ~ #{$selector} {
110
+ display: inline-block;
111
+ width: calc(#{percentage(1 / $i)} - #{$spacing});
112
+ margin-#{$global-right}: $spacing;
113
+
114
+ &:last-child {
115
+ margin-#{$global-right}: $spacing * -$buttongroup-expand-max;
116
+ }
117
+ }
118
+ }
119
+ }
58
120
  }
59
121
  }
60
122
  }
@@ -64,9 +126,38 @@ $buttongroup-expand-max: 6;
64
126
  @mixin button-group-stack(
65
127
  $selector: $buttongroup-child-selector
66
128
  ) {
129
+ @if $global-flexbox {
130
+ flex-wrap: wrap;
131
+ }
132
+
67
133
  #{$selector} {
68
- width: 100%;
69
- border-#{$global-right}: 0;
134
+ @if $global-flexbox {
135
+ flex: 0 0 100%;
136
+ }
137
+ @else {
138
+ width: 100%;
139
+ }
140
+
141
+ &:last-child {
142
+ margin-bottom: 0;
143
+ }
144
+
145
+
146
+ @if not $buttongroup-radius-on-each {
147
+ border-radius: 0;
148
+
149
+ &:first-child{
150
+ border-top-#{$global-left}-radius: $global-radius;
151
+ border-top-#{$global-right}-radius: $global-radius;
152
+ }
153
+
154
+ &:last-child {
155
+ margin-bottom: 0;
156
+ border-bottom-#{$global-left}-radius: $global-radius;
157
+ border-bottom-#{$global-right}-radius: $global-radius;
158
+ }
159
+ }
160
+
70
161
  }
71
162
  }
72
163
 
@@ -76,11 +167,28 @@ $buttongroup-expand-max: 6;
76
167
  $selector: $buttongroup-child-selector
77
168
  ) {
78
169
  #{$selector} {
79
- width: auto;
170
+ @if $global-flexbox {
171
+ flex: 1 1 0px; // sass-lint:disable-line zero-unit
172
+ }
173
+ @else {
174
+ width: auto;
175
+ }
176
+ margin-bottom: 0;
80
177
 
81
- &:not(:last-child) {
82
- border-#{$global-right}: $buttongroup-spacing solid $body-background;
178
+ @if not $buttongroup-radius-on-each {
179
+ &:first-child {
180
+ border-top-#{$global-left}-radius: $global-radius;
181
+ border-top-#{$global-right}-radius: 0;
182
+ border-bottom-#{$global-left}-radius: $global-radius;
183
+ }
184
+
185
+ &:last-child {
186
+ border-top-#{$global-right}-radius: $global-radius;
187
+ border-bottom-#{$global-right}-radius: $global-radius;
188
+ border-bottom-#{$global-left}-radius: 0;
189
+ }
83
190
  }
191
+
84
192
  }
85
193
  }
86
194
 
@@ -89,20 +197,33 @@ $buttongroup-expand-max: 6;
89
197
  @include button-group;
90
198
 
91
199
  // Sizes
92
- &.tiny { font-size: map-get($button-sizes, tiny); }
93
- &.small { font-size: map-get($button-sizes, small); }
94
- &.large { font-size: map-get($button-sizes, large); }
200
+ @each $size, $value in map-remove($button-sizes, default) {
201
+ &.#{$size} #{$buttongroup-child-selector} {
202
+ font-size: $value;
203
+ }
204
+ }
205
+
206
+ // Even-width Group
95
207
  &.expanded { @include button-group-expand; }
96
208
 
97
209
  // Colors
98
- @each $name, $color in $foundation-colors {
99
- &.#{$name} #{$buttongroup-child-selector} {
100
- @include button-style($color, auto, auto);
210
+ @each $name, $color in $foundation-palette {
211
+ @if $button-fill != hollow {
212
+ &.#{$name} #{$buttongroup-child-selector} {
213
+ @include button-style($color, auto, auto);
214
+ }
215
+ }
216
+ @else {
217
+ &.#{$name} #{$buttongroup-child-selector} {
218
+ @include button-hollow;
219
+ @include button-hollow-style($color);
220
+ }
101
221
  }
102
222
  }
103
223
 
104
224
  &.stacked,
105
- &.stacked-for-small {
225
+ &.stacked-for-small,
226
+ &.stacked-for-medium {
106
227
  @include button-group-stack;
107
228
  }
108
229
 
@@ -111,5 +232,22 @@ $buttongroup-expand-max: 6;
111
232
  @include button-group-unstack;
112
233
  }
113
234
  }
235
+
236
+ &.stacked-for-medium {
237
+ @include breakpoint(large) {
238
+ @include button-group-unstack;
239
+ }
240
+ }
241
+
242
+ &.stacked-for-small.expanded { // sass-lint:disable-line force-element-nesting
243
+ @include breakpoint(small only) {
244
+ display: block;
245
+
246
+ #{$buttongroup-child-selector} {
247
+ display: block;
248
+ margin-#{$global-right}: 0;
249
+ }
250
+ }
251
+ }
114
252
  }
115
253
  }
@@ -6,13 +6,17 @@
6
6
  /// @group button
7
7
  ////
8
8
 
9
+ /// Font family for button elements.
10
+ /// @type Font
11
+ $button-font-family: inherit !default;
12
+
9
13
  /// Padding inside buttons.
10
14
  /// @type List
11
15
  $button-padding: 0.85em 1em !default;
12
16
 
13
17
  /// Margin around buttons.
14
18
  /// @type List
15
- $button-margin: 0 $global-margin $global-margin 0 !default;
19
+ $button-margin: 0 0 $global-margin 0 !default;
16
20
 
17
21
  /// Default fill for buttons. Can either be `solid` or `hollow`.
18
22
  /// @type Keyword
@@ -28,16 +32,20 @@ $button-background-hover: scale-color($button-background, $lightness: -15%) !def
28
32
 
29
33
  /// Font color for buttons.
30
34
  /// @type List
31
- $button-color: #fff !default;
35
+ $button-color: $white !default;
32
36
 
33
- /// Font color for buttons, if the background is light.
37
+ /// Alternative font color for buttons.
34
38
  /// @type List
35
- $button-color-alt: #000 !default;
39
+ $button-color-alt: $black !default;
36
40
 
37
41
  /// Border radius for buttons, defaulted to global-radius.
38
42
  /// @type Number
39
43
  $button-radius: $global-radius !default;
40
44
 
45
+ /// Border width for hollow outline buttons
46
+ /// @type Number
47
+ $button-hollow-border-width: 1px !default;
48
+
41
49
  /// Sizes for buttons.
42
50
  /// @type Map
43
51
  $button-sizes: (
@@ -47,30 +55,59 @@ $button-sizes: (
47
55
  large: 1.25rem,
48
56
  ) !default;
49
57
 
58
+ /// Coloring classes. A map of classes to output in your CSS, like `.secondary`, `.success`, and so on.
59
+ /// @type Map
60
+ $button-palette: $foundation-palette !default;
61
+
50
62
  /// opacity for a disabled button.
51
63
  /// @type List
52
64
  $button-opacity-disabled: 0.25 !default;
53
65
 
66
+ /// Background color lightness on hover for buttons.
67
+ /// @type Number
68
+ $button-background-hover-lightness: -20% !default;
69
+
70
+ /// Color lightness on hover for hollow buttons.
71
+ /// @type Number
72
+ $button-hollow-hover-lightness: -50% !default;
73
+
54
74
  // Internal: flip from margin-right to margin-left for defaults
55
75
  @if $global-text-direction == 'rtl' {
56
- $button-margin: 0 0 $global-margin $global-margin;
76
+ $button-margin: 0 0 $global-margin $global-margin !default;
57
77
  }
58
78
 
79
+ /// transitions for buttons.
80
+ /// @type List
81
+ $button-transition: background-color 0.25s ease-out, color 0.25s ease-out !default;
82
+
59
83
  // TODO: Document button-base() mixin
60
84
  @mixin button-base {
61
85
  @include disable-mouse-outline;
62
86
  display: inline-block;
63
- text-align: center;
64
- line-height: 1;
65
- cursor: pointer;
66
- -webkit-appearance: none;
67
- transition: all 0.25s ease-out;
68
87
  vertical-align: middle;
88
+ margin: $button-margin;
89
+ font-family: $button-font-family;
90
+
91
+ @if (type-of($button-padding) == 'map') {
92
+ @each $size, $padding in $button-padding {
93
+ @include breakpoint($size) {
94
+ padding: $padding;
95
+ }
96
+ }
97
+ }
98
+ @else {
99
+ padding: $button-padding;
100
+ }
101
+
102
+ -webkit-appearance: none;
69
103
  border: 1px solid transparent;
70
104
  border-radius: $button-radius;
71
- padding: $button-padding;
72
- margin: $button-margin;
105
+ transition: $button-transition;
106
+
73
107
  font-size: map-get($button-sizes, default);
108
+ line-height: 1;
109
+ text-align: center;
110
+ cursor: pointer;
74
111
  }
75
112
 
76
113
  /// Expands a button to make it full-width.
@@ -79,8 +116,8 @@ $button-opacity-disabled: 0.25 !default;
79
116
  @if $expand {
80
117
  display: block;
81
118
  width: 100%;
82
- margin-left: 0;
83
119
  margin-right: 0;
120
+ margin-left: 0;
84
121
  }
85
122
  @else {
86
123
  display: inline-block;
@@ -96,28 +133,22 @@ $button-opacity-disabled: 0.25 !default;
96
133
  @mixin button-style(
97
134
  $background: $button-background,
98
135
  $background-hover: $button-background-hover,
99
- $color: $button-color
136
+ $color: $button-color,
137
+ $background-hover-lightness: $button-background-hover-lightness
100
138
  ) {
101
139
  @if $color == auto {
102
- $color: isitlight($background);
140
+ $color: color-pick-contrast($background, ($button-color, $button-color-alt));
103
141
  }
104
142
 
105
143
  @if $background-hover == auto {
106
- $background-hover: scale-color($background, $lightness: -20%);
144
+ $background-hover: scale-color($background, $lightness: $background-hover-lightness);
107
145
  }
108
146
 
109
- @if lightness($background) >= 70% {
110
- $color: $button-color-alt;
111
- }
112
- @else {
113
- $color: $button-color;
114
- }
115
-
116
- background: $background;
147
+ background-color: $background;
117
148
  color: $color;
118
149
 
119
150
  &:hover, &:focus {
120
- background: $background-hover;
151
+ background-color: $background-hover;
121
152
  color: $color;
122
153
  }
123
154
  }
@@ -126,27 +157,57 @@ $button-opacity-disabled: 0.25 !default;
126
157
  @mixin button-hollow {
127
158
  &,
128
159
  &:hover, &:focus {
129
- background: transparent;
160
+ background-color: transparent;
161
+ }
162
+
163
+ &.disabled,
164
+ &[disabled] {
165
+ &,
166
+ &:hover, &:focus {
167
+ background-color: transparent;
168
+ }
130
169
  }
131
170
  }
132
171
 
133
- @mixin button-hollow-style($color: $primary-color) {
134
- $color-hover: scale-color($color, $lightness: -50%);
172
+ @mixin button-hollow-style(
173
+ $color: $button-background,
174
+ $hover-lightness: $button-hollow-hover-lightness,
175
+ $border-width: $button-hollow-border-width
176
+ ) {
177
+ $color-hover: scale-color($color, $lightness: $hover-lightness);
135
178
 
136
- border: 1px solid $color;
179
+ border: $border-width solid $color;
137
180
  color: $color;
138
181
 
139
182
  &:hover, &:focus {
140
183
  border-color: $color-hover;
141
184
  color: $color-hover;
185
+ &.disabled,
186
+ &[disabled] {
187
+ border: $border-width solid $color;
188
+ color: $color;
189
+ }
142
190
  }
143
191
  }
144
192
 
145
193
  /// Adds disabled styles to a button by fading the element, reseting the cursor, and disabling pointer events.
146
- @mixin button-disabled {
194
+ /// @param [Color] $background [$button-background] - Background color of the disabled button.
195
+ /// @param [Color] $color [$button-color] - Text color of the disabled button. Set to `auto` to have the mixin automatically generate a color based on the background color.
196
+ @mixin button-disabled(
197
+ $background: $button-background,
198
+ $color: $button-color
199
+ ) {
200
+ @if $color == auto {
201
+ $color: color-pick-contrast($background, ($button-color, $button-color-alt));
202
+ }
203
+
147
204
  opacity: $button-opacity-disabled;
148
205
  cursor: not-allowed;
149
- pointer-events: none;
206
+
207
+ &, &:hover, &:focus {
208
+ background-color: $background;
209
+ color: $color;
210
+ }
150
211
  }
151
212
 
152
213
  /// Adds a dropdown arrow to a button.
@@ -162,9 +223,10 @@ $button-opacity-disabled: 0.25 !default;
162
223
  @include css-triangle($size, $color, down);
163
224
  position: relative;
164
225
  top: 0.4em; // Aligns the arrow with the text of the button
165
- float: #{$global-right};
166
- margin-#{$global-left}: get-side($button-padding, right);
226
+
167
227
  display: inline-block;
228
+ float: #{$global-right};
229
+ margin-#{$global-left}: $offset;
168
230
  }
169
231
  }
170
232
 
@@ -201,16 +263,19 @@ $button-opacity-disabled: 0.25 !default;
201
263
  @include button;
202
264
 
203
265
  // Sizes
204
- &.tiny { font-size: map-get($button-sizes, tiny); }
205
- &.small { font-size: map-get($button-sizes, small); }
206
- &.large { font-size: map-get($button-sizes, large); }
266
+ @each $size, $value in map-remove($button-sizes, default) {
267
+ &.#{$size} {
268
+ font-size: $value;
269
+ }
270
+ }
271
+
207
272
  &.expanded { @include button-expand; }
208
273
 
209
274
  // Colors
210
- @each $name, $color in $foundation-colors {
275
+ @each $name, $color in $button-palette {
211
276
  @if $button-fill != hollow {
212
277
  &.#{$name} {
213
- @include button-style($color, auto);
278
+ @include button-style($color, auto, auto);
214
279
  }
215
280
  }
216
281
  @else {
@@ -224,13 +289,25 @@ $button-opacity-disabled: 0.25 !default;
224
289
  }
225
290
  }
226
291
 
292
+ // Disabled style
293
+ &.disabled,
294
+ &[disabled] {
295
+ @include button-disabled;
296
+
297
+ @each $name, $color in $button-palette {
298
+ &.#{$name} {
299
+ @include button-disabled($color, auto);
300
+ }
301
+ }
302
+ }
303
+
227
304
  // Hollow style
228
305
  @if $button-fill != hollow {
229
306
  &.hollow {
230
307
  @include button-hollow;
231
308
  @include button-hollow-style;
232
309
 
233
- @each $name, $color in $foundation-colors {
310
+ @each $name, $color in $button-palette {
234
311
  &.#{$name} {
235
312
  @include button-hollow-style($color);
236
313
  }
@@ -238,9 +315,33 @@ $button-opacity-disabled: 0.25 !default;
238
315
  }
239
316
  }
240
317
 
241
- // Disabled style
242
- &.disabled {
243
- @include button-disabled;
318
+ // Clear style
319
+ @if $button-fill != clear {
320
+ &.clear {
321
+ @include button-hollow;
322
+ @include button-hollow-style;
323
+
324
+ &, &:hover, &:focus {
325
+ &, &.disabled, &[disabled] {
326
+ border-color: transparent;
327
+ }
328
+ }
329
+
330
+ @each $name, $color in $button-palette {
331
+ &.#{$name} {
332
+ @include button-hollow-style($color);
333
+
334
+ &, &:hover,
335
+ &:focus {
336
+ &,
337
+ &.disabled,
338
+ &[disabled] {
339
+ border-color: transparent;
340
+ }
341
+ }
342
+ }
343
+ }
344
+ }
244
345
  }
245
346
 
246
347
  // Dropdown arrow
@@ -252,13 +353,33 @@ $button-opacity-disabled: 0.25 !default;
252
353
  border-top-color: $button-background;
253
354
  }
254
355
  }
356
+
357
+ &.hollow {
358
+ &::after {
359
+ border-top-color: $button-background;
360
+ }
361
+
362
+ @each $name, $color in $button-palette {
363
+ &.#{$name} {
364
+ &::after {
365
+ border-top-color: $color;
366
+ }
367
+ }
368
+ }
369
+ }
255
370
  }
256
371
 
257
372
  // Button with dropdown arrow only
258
373
  &.arrow-only::after {
259
- margin-#{$global-left}: 0;
374
+ top: -0.1em;
260
375
  float: none;
261
- top: 0.2em;
376
+ margin-#{$global-left}: 0;
377
+ }
378
+ }
379
+ a.button {
380
+ &:hover,
381
+ &:focus {
382
+ text-decoration: none;
262
383
  }
263
384
  }
264
385
  }