foundation-rails 5.2.3.0 → 5.3.0.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (45) hide show
  1. checksums.yaml +4 -4
  2. data/bower.json +2 -2
  3. data/lib/foundation/rails/version.rb +1 -1
  4. data/test/dummy/.ruby-version +1 -0
  5. data/vendor/assets/_settings.scss +1298 -0
  6. data/vendor/assets/javascripts/foundation/foundation.abide.js +4 -4
  7. data/vendor/assets/javascripts/foundation/foundation.accordion.js +7 -1
  8. data/vendor/assets/javascripts/foundation/foundation.alert.js +3 -3
  9. data/vendor/assets/javascripts/foundation/foundation.clearing.js +17 -9
  10. data/vendor/assets/javascripts/foundation/foundation.dropdown.js +7 -5
  11. data/vendor/assets/javascripts/foundation/foundation.equalizer.js +2 -2
  12. data/vendor/assets/javascripts/foundation/foundation.interchange.js +24 -11
  13. data/vendor/assets/javascripts/foundation/foundation.joyride.js +14 -11
  14. data/vendor/assets/javascripts/foundation/foundation.js +6 -4
  15. data/vendor/assets/javascripts/foundation/foundation.magellan.js +5 -3
  16. data/vendor/assets/javascripts/foundation/foundation.offcanvas.js +2 -2
  17. data/vendor/assets/javascripts/foundation/foundation.orbit.js +123 -261
  18. data/vendor/assets/javascripts/foundation/foundation.reveal.js +15 -15
  19. data/vendor/assets/javascripts/foundation/foundation.slider.js +51 -24
  20. data/vendor/assets/javascripts/foundation/foundation.topbar.js +13 -12
  21. data/vendor/assets/javascripts/vendor/modernizr.js +3 -3
  22. data/vendor/assets/stylesheets/foundation.scss +2 -1
  23. data/vendor/assets/stylesheets/foundation/_settings.scss +19 -10
  24. data/vendor/assets/stylesheets/foundation/components/_accordion.scss +115 -1
  25. data/vendor/assets/stylesheets/foundation/components/_block-grid.scss +2 -2
  26. data/vendor/assets/stylesheets/foundation/components/_button-groups.scss +9 -1
  27. data/vendor/assets/stylesheets/foundation/components/_forms.scss +8 -6
  28. data/vendor/assets/stylesheets/foundation/components/_global.scss +12 -7
  29. data/vendor/assets/stylesheets/foundation/components/_grid.scss +17 -4
  30. data/vendor/assets/stylesheets/foundation/components/_icon-bar.scss +229 -0
  31. data/vendor/assets/stylesheets/foundation/components/_iconbar.scss +67 -0
  32. data/vendor/assets/stylesheets/foundation/components/_offcanvas.scss +18 -16
  33. data/vendor/assets/stylesheets/foundation/components/_orbit.scss +84 -139
  34. data/vendor/assets/stylesheets/foundation/components/_panels.scss +6 -3
  35. data/vendor/assets/stylesheets/foundation/components/_range-slider.scss +20 -5
  36. data/vendor/assets/stylesheets/foundation/components/_reveal-new.scss +0 -0
  37. data/vendor/assets/stylesheets/foundation/components/_side-nav.scss +1 -1
  38. data/vendor/assets/stylesheets/foundation/components/_switches.scss +215 -0
  39. data/vendor/assets/stylesheets/foundation/components/_tabs.scss +1 -1
  40. data/vendor/assets/stylesheets/foundation/components/_toolbar.scss +67 -0
  41. data/vendor/assets/stylesheets/foundation/components/_tooltips.scss +2 -1
  42. data/vendor/assets/stylesheets/foundation/components/_top-bar.scss +26 -11
  43. data/vendor/assets/stylesheets/foundation/components/_type.scss +2 -0
  44. metadata +10 -3
  45. data/vendor/assets/stylesheets/foundation/components/_switch.scss +0 -294
@@ -15,6 +15,7 @@
15
15
  close_on_esc: true,
16
16
  dismiss_modal_class: 'close-reveal-modal',
17
17
  bg_class: 'reveal-modal-bg',
18
+ root_element: 'body',
18
19
  open: function(){},
19
20
  opened: function(){},
20
21
  close: function(){},
@@ -45,7 +46,7 @@
45
46
 
46
47
  S(this.scope)
47
48
  .off('.reveal')
48
- .on('click.fndtn.reveal', '[' + this.add_namespace('data-reveal-id') + ']', function (e) {
49
+ .on('click.fndtn.reveal', '[' + this.add_namespace('data-reveal-id') + ']:not([disabled])', function (e) {
49
50
  e.preventDefault();
50
51
 
51
52
  if (!self.locked) {
@@ -162,7 +163,7 @@
162
163
  }
163
164
 
164
165
  this.key_up_on(modal); // PATCH #3: turning on key up capture only when a reveal window is open
165
- modal.trigger('open');
166
+ modal.trigger('open').trigger('open.fndtn.reveal');
166
167
 
167
168
  if (open_modal.length < 1) {
168
169
  this.toggle_bg(modal, true);
@@ -213,7 +214,7 @@
213
214
  if (open_modals.length > 0) {
214
215
  this.locked = true;
215
216
  this.key_up_off(modal); // PATCH #3: turning on key up capture only when a reveal window is open
216
- modal.trigger('close');
217
+ modal.trigger('close').trigger('close.fndtn.reveal');
217
218
  this.toggle_bg(modal, false);
218
219
  this.hide(open_modals, settings.css.close, settings);
219
220
  }
@@ -248,19 +249,18 @@
248
249
  show : function (el, css) {
249
250
  // is modal
250
251
  if (css) {
251
- var settings = el.data(this.attr_name(true) + '-init');
252
- settings = settings || this.settings;
252
+ var settings = el.data(this.attr_name(true) + '-init') || this.settings,
253
+ root_element = settings.root_element;
253
254
 
254
- if (el.parent('body').length === 0) {
255
- var placeholder = el.wrap('<div style="display: none;" />').parent(),
256
- rootElement = this.settings.rootElement || 'body';
255
+ if (el.parent(root_element).length === 0) {
256
+ var placeholder = el.wrap('<div style="display: none;" />').parent();
257
257
 
258
258
  el.on('closed.fndtn.reveal.wrapped', function() {
259
259
  el.detach().appendTo(placeholder);
260
260
  el.unwrap().unbind('closed.fndtn.reveal.wrapped');
261
261
  });
262
262
 
263
- el.detach().appendTo(rootElement);
263
+ el.detach().appendTo(root_element);
264
264
  }
265
265
 
266
266
  var animData = getAnimationData(settings.animation);
@@ -279,7 +279,7 @@
279
279
  .css(css)
280
280
  .animate(end_css, settings.animation_speed, 'linear', function () {
281
281
  this.locked = false;
282
- el.trigger('opened');
282
+ el.trigger('opened').trigger('opened.fndtn.reveal');
283
283
  }.bind(this))
284
284
  .addClass('open');
285
285
  }.bind(this), settings.animation_speed / 2);
@@ -294,13 +294,13 @@
294
294
  .css(css)
295
295
  .animate(end_css, settings.animation_speed, 'linear', function () {
296
296
  this.locked = false;
297
- el.trigger('opened');
297
+ el.trigger('opened').trigger('opened.fndtn.reveal');
298
298
  }.bind(this))
299
299
  .addClass('open');
300
300
  }.bind(this), settings.animation_speed / 2);
301
301
  }
302
302
 
303
- return el.css(css).show().css({opacity: 1}).addClass('open').trigger('opened');
303
+ return el.css(css).show().css({opacity: 1}).addClass('open').trigger('opened').trigger('opened.fndtn.reveal');
304
304
  }
305
305
 
306
306
  var settings = this.settings;
@@ -335,7 +335,7 @@
335
335
  return el
336
336
  .animate(end_css, settings.animation_speed, 'linear', function () {
337
337
  this.locked = false;
338
- el.css(css).trigger('closed');
338
+ el.css(css).trigger('closed').trigger('closed.fndtn.reveal');
339
339
  }.bind(this))
340
340
  .removeClass('open');
341
341
  }.bind(this), settings.animation_speed / 2);
@@ -348,13 +348,13 @@
348
348
  return el
349
349
  .animate(end_css, settings.animation_speed, 'linear', function () {
350
350
  this.locked = false;
351
- el.css(css).trigger('closed');
351
+ el.css(css).trigger('closed').trigger('closed.fndtn.reveal');
352
352
  }.bind(this))
353
353
  .removeClass('open');
354
354
  }.bind(this), settings.animation_speed / 2);
355
355
  }
356
356
 
357
- return el.hide().css(css).removeClass('open').trigger('closed');
357
+ return el.hide().css(css).removeClass('open').trigger('closed').trigger('closed.fndtn.reveal');
358
358
  }
359
359
 
360
360
  var settings = this.settings;
@@ -12,6 +12,7 @@
12
12
  step: 1,
13
13
  initial: null,
14
14
  display_selector: '',
15
+ vertical: false,
15
16
  on_change: function(){}
16
17
  },
17
18
 
@@ -29,7 +30,7 @@
29
30
  $(this.scope)
30
31
  .off('.slider')
31
32
  .on('mousedown.fndtn.slider touchstart.fndtn.slider pointerdown.fndtn.slider',
32
- '[' + self.attr_name() + '] .range-slider-handle', function(e) {
33
+ '[' + self.attr_name() + ']:not(.disabled, [disabled]) .range-slider-handle', function(e) {
33
34
  if (!self.cache.active) {
34
35
  e.preventDefault();
35
36
  self.set_active_slider($(e.target));
@@ -38,7 +39,17 @@
38
39
  .on('mousemove.fndtn.slider touchmove.fndtn.slider pointermove.fndtn.slider', function(e) {
39
40
  if (!!self.cache.active) {
40
41
  e.preventDefault();
41
- self.calculate_position(self.cache.active, e.pageX || e.originalEvent.clientX || e.originalEvent.touches[0].clientX || e.currentPoint.x);
42
+ if ($.data(self.cache.active[0], 'settings').vertical) {
43
+ self.calculate_position(self.cache.active, e.pageY ||
44
+ e.originalEvent.clientY ||
45
+ e.originalEvent.touches[0].clientY ||
46
+ e.currentPoint.y);
47
+ } else {
48
+ self.calculate_position(self.cache.active, e.pageX ||
49
+ e.originalEvent.clientX ||
50
+ e.originalEvent.touches[0].clientX ||
51
+ e.currentPoint.x);
52
+ }
42
53
  }
43
54
  })
44
55
  .on('mouseup.fndtn.slider touchend.fndtn.slider pointerup.fndtn.slider', function(e) {
@@ -64,21 +75,23 @@
64
75
 
65
76
  calculate_position : function($handle, cursor_x) {
66
77
  var self = this,
67
- settings = $.extend({}, self.settings, self.data_options($handle.parent())),
68
- handle_w = $.data($handle[0], 'handle_w'),
78
+ settings = $.data($handle[0], 'settings'),
79
+ handle_l = $.data($handle[0], 'handle_l'),
69
80
  handle_o = $.data($handle[0], 'handle_o'),
70
- bar_w = $.data($handle[0], 'bar_w'),
81
+ bar_l = $.data($handle[0], 'bar_l'),
71
82
  bar_o = $.data($handle[0], 'bar_o');
72
83
 
73
84
  requestAnimationFrame(function(){
74
85
  var pct;
75
86
 
76
- if (Foundation.rtl) {
77
- pct = self.limit_to(((bar_o+bar_w-cursor_x)/bar_w),0,1);
87
+ if (Foundation.rtl && !settings.vertical) {
88
+ pct = self.limit_to(((bar_o+bar_l-cursor_x)/bar_l),0,1);
78
89
  } else {
79
- pct = self.limit_to(((cursor_x-bar_o)/bar_w),0,1);
90
+ pct = self.limit_to(((cursor_x-bar_o)/bar_l),0,1);
80
91
  }
81
92
 
93
+ pct = settings.vertical ? 1-pct : pct;
94
+
82
95
  var norm = self.normalized_value(pct, settings.start, settings.end, settings.step);
83
96
 
84
97
  self.set_ui($handle, norm);
@@ -86,22 +99,27 @@
86
99
  },
87
100
 
88
101
  set_ui : function($handle, value) {
89
- var settings = $.extend({}, this.settings, this.data_options($handle.parent())),
90
- handle_w = $.data($handle[0], 'handle_w'),
91
- bar_w = $.data($handle[0], 'bar_w'),
102
+ var settings = $.data($handle[0], 'settings'),
103
+ handle_l = $.data($handle[0], 'handle_l'),
104
+ bar_l = $.data($handle[0], 'bar_l'),
92
105
  norm_pct = this.normalized_percentage(value, settings.start, settings.end),
93
- handle_offset = norm_pct*(bar_w-handle_w)-1,
94
- progress_bar_width = norm_pct*100;
106
+ handle_offset = norm_pct*(bar_l-handle_l)-1,
107
+ progress_bar_length = norm_pct*100;
95
108
 
96
- if (Foundation.rtl) {
109
+ if (Foundation.rtl && !settings.vertical) {
97
110
  handle_offset = -handle_offset;
98
111
  }
99
112
 
100
- this.set_translate($handle, handle_offset);
101
- $handle.siblings('.range-slider-active-segment').css('width', progress_bar_width+'%');
113
+ handle_offset = settings.vertical ? -handle_offset + bar_l - handle_l + 1 : handle_offset;
114
+ this.set_translate($handle, handle_offset, settings.vertical);
102
115
 
103
- $handle.parent().attr(this.attr_name(), value);
104
- $handle.parent().trigger('change');
116
+ if (settings.vertical) {
117
+ $handle.siblings('.range-slider-active-segment').css('height', progress_bar_length + '%');
118
+ } else {
119
+ $handle.siblings('.range-slider-active-segment').css('width', progress_bar_length + '%');
120
+ }
121
+
122
+ $handle.parent().attr(this.attr_name(), value).trigger('change').trigger('change.fndtn.slider');
105
123
 
106
124
  $handle.parent().children('input[type=hidden]').val(value);
107
125
 
@@ -153,12 +171,22 @@
153
171
  },
154
172
 
155
173
  initialize_settings : function(handle) {
174
+ var settings = $.extend({}, this.settings, this.data_options($(handle).parent()));
175
+
176
+ if (settings.vertical) {
177
+ $.data(handle, 'bar_o', $(handle).parent().offset().top);
178
+ $.data(handle, 'bar_l', $(handle).parent().outerHeight());
179
+ $.data(handle, 'handle_o', $(handle).offset().top);
180
+ $.data(handle, 'handle_l', $(handle).outerHeight());
181
+ } else {
182
+ $.data(handle, 'bar_o', $(handle).parent().offset().left);
183
+ $.data(handle, 'bar_l', $(handle).parent().outerWidth());
184
+ $.data(handle, 'handle_o', $(handle).offset().left);
185
+ $.data(handle, 'handle_l', $(handle).outerWidth());
186
+ }
187
+
156
188
  $.data(handle, 'bar', $(handle).parent());
157
- $.data(handle, 'bar_o', $(handle).parent().offset().left);
158
- $.data(handle, 'bar_w', $(handle).parent().outerWidth());
159
- $.data(handle, 'handle_o', $(handle).offset().left);
160
- $.data(handle, 'handle_w', $(handle).outerWidth());
161
- $.data(handle, 'settings', $.extend({}, this.settings, this.data_options($(handle).parent())));
189
+ $.data(handle, 'settings', settings);
162
190
  },
163
191
 
164
192
  set_initial_position : function($ele) {
@@ -193,7 +221,6 @@
193
221
  }
194
222
  });
195
223
  }
196
-
197
224
  };
198
225
 
199
226
  }(jQuery, window, window.document));
@@ -12,11 +12,10 @@
12
12
  custom_back_text: true,
13
13
  back_text: 'Back',
14
14
  is_hover: true,
15
- mobile_show_parent_link: false,
16
15
  scrolltop : true, // jump to top when sticky nav menu toggle is clicked
17
16
  sticky_on : 'all'
18
17
  },
19
-
18
+
20
19
  init : function (section, method, options) {
21
20
  Foundation.inherit(this, 'add_custom_rule register_media throttle');
22
21
  var self = this;
@@ -66,11 +65,17 @@
66
65
  if (sticky && settings.sticky_on === 'all') {
67
66
  return true;
68
67
  } else if (sticky && this.small() && settings.sticky_on === 'small') {
69
- return true;
68
+ return (matchMedia(Foundation.media_queries.small).matches && !matchMedia(Foundation.media_queries.medium).matches &&
69
+ !matchMedia(Foundation.media_queries.large).matches);
70
+ //return true;
70
71
  } else if (sticky && this.medium() && settings.sticky_on === 'medium') {
71
- return true;
72
- } else if (sticky && this.large() && settings.sticky_on === 'large') {
73
- return true;
72
+ return (matchMedia(Foundation.media_queries.small).matches && matchMedia(Foundation.media_queries.medium).matches &&
73
+ !matchMedia(Foundation.media_queries.large).matches);
74
+ //return true;
75
+ } else if(sticky && this.large() && settings.sticky_on === 'large') {
76
+ return (matchMedia(Foundation.media_queries.small).matches && matchMedia(Foundation.media_queries.medium).matches &&
77
+ matchMedia(Foundation.media_queries.large).matches);
78
+ //return true;
74
79
  }
75
80
 
76
81
  return false;
@@ -225,7 +230,7 @@
225
230
 
226
231
  S(window).off('.topbar').on('resize.fndtn.topbar', self.throttle(function () {
227
232
  self.resize.call(self);
228
- }, 50)).trigger('resize');
233
+ }, 50)).trigger('resize').trigger('resize.fndtn.topbar');
229
234
 
230
235
  S('body').off('.topbar').on('click.fndtn.topbar touchstart.fndtn.topbar', function (e) {
231
236
  var parent = S(e.target).closest('li').closest('li.hover');
@@ -344,11 +349,7 @@
344
349
  $titleLi;
345
350
 
346
351
  if (!$dropdown.find('.title.back').length) {
347
- if (settings.mobile_show_parent_link && url && url.length > 1) {
348
- $titleLi = $('<li class="title back js-generated"><h5><a href="javascript:void(0)"></a></h5></li><li><a class="parent-link js-generated" href="' + url + '">' + $link.text() +'</a></li>');
349
- } else {
350
- $titleLi = $('<li class="title back js-generated"><h5><a href="javascript:void(0)"></a></h5></li>');
351
- }
352
+ $titleLi = $('<li class="title back js-generated"><h5><a href="javascript:void(0)"></a></h5></li>');
352
353
 
353
354
  // Copy link to subnav
354
355
  if (settings.custom_back_text == true) {
@@ -1,5 +1,5 @@
1
1
  /*!
2
- * Modernizr v2.7.2
2
+ * Modernizr v2.8.2
3
3
  * www.modernizr.com
4
4
  *
5
5
  * Copyright (c) Faruk Ates, Paul Irish, Alex Sexton
@@ -24,7 +24,7 @@
24
24
 
25
25
  window.Modernizr = (function( window, document, undefined ) {
26
26
 
27
- var version = '2.7.2',
27
+ var version = '2.8.2',
28
28
 
29
29
  Modernizr = {},
30
30
 
@@ -156,7 +156,7 @@ window.Modernizr = (function( window, document, undefined ) {
156
156
 
157
157
  var matchMedia = window.matchMedia || window.msMatchMedia;
158
158
  if ( matchMedia ) {
159
- return matchMedia(mq).matches;
159
+ return matchMedia(mq) && matchMedia(mq).matches || false;
160
160
  }
161
161
 
162
162
  var bool;
@@ -19,6 +19,7 @@
19
19
  "foundation/components/dropdown-buttons",
20
20
  "foundation/components/flex-video",
21
21
  "foundation/components/forms",
22
+ "foundation/components/icon-bar",
22
23
  "foundation/components/inline-lists",
23
24
  "foundation/components/joyride",
24
25
  "foundation/components/keystrokes",
@@ -34,7 +35,7 @@
34
35
  "foundation/components/side-nav",
35
36
  "foundation/components/split-buttons",
36
37
  "foundation/components/sub-nav",
37
- "foundation/components/switch",
38
+ "foundation/components/switches",
38
39
  "foundation/components/tables",
39
40
  "foundation/components/tabs",
40
41
  "foundation/components/thumbs",
@@ -30,9 +30,9 @@
30
30
  // $include-print-styles: true;
31
31
  // $include-html-global-classes: $include-html-classes;
32
32
 
33
- // Grid
33
+ // Grid
34
34
 
35
- // $include-html-grid-classes: $include-html-classes;
35
+ // $include-html-block-grid-classes: $include-html-classes;
36
36
  // $include-xl-html-grid-classes: false;
37
37
 
38
38
  // $row-width: rem-calc(1000);
@@ -40,6 +40,10 @@
40
40
 
41
41
  // Global
42
42
 
43
+ // We use these to define default font weights
44
+ // $font-weight-normal: normal !default
45
+ // $font-weight-bold: bold !default
46
+
43
47
  // We use these to control various global styles
44
48
  // $body-bg: #fff;
45
49
  // $body-font-color: #222;
@@ -137,6 +141,14 @@
137
141
  // $h5-font-size: rem-calc(18);
138
142
  // $h6-font-size: 1rem;
139
143
 
144
+ // We use these to control header size reduction on small screens
145
+ // $h1-font-reduction: rem-calc(10) !default;
146
+ // $h2-font-reduction: rem-calc(10) !default;
147
+ // $h3-font-reduction: rem-calc(5) !default;
148
+ // $h4-font-reduction: rem-calc(5) !default;
149
+ // $h5-font-reduction: 0 !default;
150
+ // $h6-font-reduction: 0 !default;
151
+
140
152
  // These control how subheaders are styled.
141
153
  // $subheader-line-height: 1.4;
142
154
  // $subheader-font-color: scale-color($header-font-color, $lightness: 35%);
@@ -670,6 +682,7 @@
670
682
 
671
683
  // $tabbar-bg: #333;
672
684
  // $tabbar-height: rem-calc(45);
685
+ // $tabbar-icon-width: $tabbar-height;
673
686
  // $tabbar-line-height: $tabbar-height;
674
687
  // $tabbar-color: #fff;
675
688
  // $tabbar-middle-padding: 0 rem-calc(10);
@@ -708,14 +721,13 @@
708
721
  // $tabbar-menu-icon-text-indent: rem-calc(35);
709
722
  // $tabbar-menu-icon-width: $tabbar-height;
710
723
  // $tabbar-menu-icon-height: $tabbar-height;
711
- // $tabbar-menu-icon-line-height: rem-calc(33);
712
724
  // $tabbar-menu-icon-padding: 0;
713
725
 
714
726
  // $tabbar-hamburger-icon-width: rem-calc(16);
715
727
  // $tabbar-hamburger-icon-left: false;
716
728
  // $tabbar-hamburger-icon-top: false;
717
- // $tapbar-hamburger-icon-thickness: 1px;
718
- // $tapbar-hamburger-icon-gap: 6px;
729
+ // $tabbar-hamburger-icon-thickness: 1px;
730
+ // $tabbar-hamburger-icon-gap: 6px;
719
731
 
720
732
  // Off Canvas Back-Link Overlay
721
733
  // $off-canvas-overlay-transition: background 300ms ease;
@@ -760,10 +772,6 @@
760
772
  // $orbit-slide-number-font-color: #fff;
761
773
  // $orbit-slide-number-padding: rem-calc(5);
762
774
 
763
- // We use these to controls the css animation
764
- // $orbit-animation-speed: 500ms;
765
- // $orbit-animation-ease: ease-in-out;
766
-
767
775
  // Hide controls on small
768
776
  // $orbit-nav-hide-for-small: true;
769
777
  // $orbit-bullet-hide-for-small: true;
@@ -1169,6 +1177,7 @@
1169
1177
  // $tooltip-radius: $global-radius;
1170
1178
  // $tooltip-rounded: $global-rounded;
1171
1179
  // $tooltip-pip-size: 5px;
1180
+ // $tooltip-max-width: 300px;
1172
1181
 
1173
1182
  //
1174
1183
  // TOP BAR
@@ -1206,7 +1215,7 @@
1206
1215
  // $topbar-link-font-size: rem-calc(13);
1207
1216
  // $topbar-link-hover-lightness: -10%; // Darken by 10%
1208
1217
  // $topbar-link-bg: $topbar-bg;
1209
- // $topbar-link-bg-color-hover: #272727;
1218
+ // $topbar-link-bg-color-hover: #555555;
1210
1219
  // $topbar-link-bg-hover: #272727;
1211
1220
  // $topbar-link-bg-active: $primary-color;
1212
1221
  // $topbar-link-bg-active-hover: scale-color($primary-color, $lightness: -14%);
@@ -21,11 +21,125 @@ $accordion-navigation-font-family: $body-font-family !default;
21
21
  $accordion-content-padding: $column-gutter/2 !default;
22
22
  $accordion-content-active-bg-color: #fff !default;
23
23
 
24
+ /*
25
+ Mixin: accordion-container()
26
+
27
+ Decription: Responsible for the container component of accordions, generating styles relating to a margin of zero and a clearfix
28
+
29
+ Explicit Dependencies: a clearfix mixin *is* defined.
30
+
31
+ Implicit Dependencies: None
32
+
33
+ */
34
+
35
+ @mixin accordion-container() {
36
+ @include clearfix;
37
+ margin-bottom: 0;
38
+ }
39
+
40
+ /*
41
+ Mixin: accordion-navigation( $bg, $hover-bg, $active-bg, $padding, $active_class, $font-color, $font-size, $font-family){
42
+
43
+ @params $bg-color: [ color or string ]: Specify the background color for the navigation element
44
+ @params $hover-bg-color [ color or string ]: Specify the background color for the navigation element when hovered
45
+ @params $active-bg [ color or string ]: Specify the background color for the navigation element when clicked and not released.
46
+ @params $active_class [ string ]: Specify the class name used to keep track of which accordion tab should be visible
47
+ @params $font-color [ color or string ]: Color of the font for accordion
48
+ @params $font-size [ number ]: Specifiy the font-size of the text inside the navigation element
49
+ @params $font-family [ string ]: Specify the font family for the text of the navigation of the accorion
50
+ */
51
+
52
+ @mixin accordion-navigation( $bg: $accordion-navigation-bg-color, $hover-bg: $accordion-navigation-hover-bg-color, $active-bg: $accordion-navigation-active-bg-color, $padding: $accordion-navigation-padding, $active_class: 'active', $font-color: $accordion-navigation-font-color, $font-size: $accordion-navigation-font-size, $font-family: $accordion-navigation-font-family ){
53
+ display: block;
54
+ margin-bottom: 0 !important;
55
+ @if type-of($active_class) != "string" {
56
+ @warn "`#{$active_class}` isn't a valid string. A valid string is needed to correctly be interpolated as a CSS class. CSS classes cannot start with a number or consist of only numbers. CSS will not be generated for the active state of this navigation component."
57
+ }
58
+ @else {
59
+ &.#{ $active_class } > a {
60
+ background: $active-bg;
61
+ }
62
+ }
63
+ > a {
64
+ background: $bg;
65
+ color: $font-color;
66
+ @if type-of($padding) != number {
67
+ @warn "`#{$padding}` was read as #{type-of($padding)}";
68
+ @if $accordion-navigation-padding != null {
69
+ @warn "#{$padding} was read as a #{type-of($padding)}";
70
+ @warn "`#{$padding}` isn't a valid number. $accordion-navigation-padding (#{$accordion-navigation-padding}) will be used instead.)";
71
+ padding: $accordion-navigation-padding;
72
+ }
73
+ @else {
74
+ @warn "`#{$padding}` isn't a valid number and $accordion-navigation-padding is missing. A value of `null` is returned to not output an invalid value for padding";
75
+ padding: null;
76
+ }
77
+ }
78
+ @else {
79
+ padding: $padding;
80
+ }
81
+ display: block;
82
+ font-family: $font-family;
83
+ @if type-of($font-size) != number {
84
+ @warn "`#{$font-size}` was read as a #{type-of($font-size)}";
85
+ @if $accordion-navigation-font-size != null {
86
+ @warn "`#{$font-size}` is not a valid number. The value of $accordion-navigation-font-size will be used instead (#{$accordion-navigation-font-size}).";
87
+ font-size: $accordion-navigation-font-size;
88
+ }
89
+ @else{
90
+ @warn "`#{$font-size}` is not a valid number and the default value of $accordion-navigation-font-size is not defined. A value of `null` will be returned to not generate a value for font-size.";
91
+ font-size: null;
92
+
93
+ }
94
+ }
95
+ @else {
96
+ font-size: $font-size;
97
+ }
98
+ &:hover {
99
+ background: $hover-bg;
100
+ }
101
+ }
102
+ }
103
+
104
+ /*
105
+
106
+ Mixin: accordion-content($bg, $padding, $active-class)
107
+ @params $padding [ number ]: Padding for the content of the container
108
+ @params $bg [ color ]: Background color for the content when it's visible
109
+ @params $active_class [ string ]: Class name used to keep track of which accordion tab should be visible.
110
+ */
111
+
112
+ @mixin accordion-content($bg: $accordion-content-active-bg-color, $padding: $accordion-content-padding, $active_class: 'active'){
113
+ display: none;
114
+ @if type-of($padding) != "number" {
115
+ @warn "#{$padding} was read as a #{type-of($padding)}";
116
+ @if $accordion-content-padding != null {
117
+ @warn "`#{$padding}` isn't a valid number. $accordion-content-padding used instead";
118
+ padding: $accordion-content-padding;
119
+ } @else {
120
+ @warn "`#{$padding}` isn't a valid number and the default value of $accordion-content-padding is not defined. A value of `null` is returned to not output an invalid value for padding.";
121
+ padding: null;
122
+ }
123
+ } @else {
124
+ padding: $padding;
125
+ }
126
+
127
+ @if type-of($active_class) != "string" {
128
+ @warn "`#{$active_class}` isn't a valid string. A valid string is needed to correctly be interpolated as a CSS class. CSS classes cannot start with a number or consist of only numbers. CSS will not be generated for the active state of the content. "
129
+ }
130
+ @else {
131
+ &.#{$active_class} {
132
+ display: block;
133
+ background: $bg;
134
+ }
135
+ }
136
+ }
137
+
24
138
  @include exports("accordion") {
25
139
  @if $include-html-accordion-classes {
26
140
  .accordion {
27
141
  @include clearfix; margin-bottom: 0;
28
- dd {
142
+ .accordion-navigation, dd {
29
143
  display: block;
30
144
  margin-bottom: 0 !important;
31
145
  &.active > a { background: $accordion-navigation-active-bg-color; }