uikit 3.14.2-dev.f917389f5 → 3.14.3-dev.68d38eb6d

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 (87) hide show
  1. package/CHANGELOG.md +17 -1
  2. package/dist/css/uikit-core-rtl.css +48 -3
  3. package/dist/css/uikit-core-rtl.min.css +1 -1
  4. package/dist/css/uikit-core.css +48 -3
  5. package/dist/css/uikit-core.min.css +1 -1
  6. package/dist/css/uikit-rtl.css +52 -3
  7. package/dist/css/uikit-rtl.min.css +1 -1
  8. package/dist/css/uikit.css +52 -3
  9. package/dist/css/uikit.min.css +1 -1
  10. package/dist/js/components/countdown.js +1 -1
  11. package/dist/js/components/countdown.min.js +1 -1
  12. package/dist/js/components/filter.js +1 -1
  13. package/dist/js/components/filter.min.js +1 -1
  14. package/dist/js/components/lightbox-panel.js +101 -17
  15. package/dist/js/components/lightbox-panel.min.js +1 -1
  16. package/dist/js/components/lightbox.js +101 -17
  17. package/dist/js/components/lightbox.min.js +1 -1
  18. package/dist/js/components/notification.js +1 -1
  19. package/dist/js/components/notification.min.js +1 -1
  20. package/dist/js/components/parallax.js +70 -35
  21. package/dist/js/components/parallax.min.js +1 -1
  22. package/dist/js/components/slider-parallax.js +55 -35
  23. package/dist/js/components/slider-parallax.min.js +1 -1
  24. package/dist/js/components/slider.js +1 -1
  25. package/dist/js/components/slider.min.js +1 -1
  26. package/dist/js/components/slideshow-parallax.js +55 -35
  27. package/dist/js/components/slideshow-parallax.min.js +1 -1
  28. package/dist/js/components/slideshow.js +1 -1
  29. package/dist/js/components/slideshow.min.js +1 -1
  30. package/dist/js/components/sortable.js +1 -1
  31. package/dist/js/components/sortable.min.js +1 -1
  32. package/dist/js/components/tooltip.js +135 -39
  33. package/dist/js/components/tooltip.min.js +1 -1
  34. package/dist/js/components/upload.js +1 -1
  35. package/dist/js/components/upload.min.js +1 -1
  36. package/dist/js/uikit-core.js +229 -105
  37. package/dist/js/uikit-core.min.js +1 -1
  38. package/dist/js/uikit-icons.js +1 -1
  39. package/dist/js/uikit-icons.min.js +1 -1
  40. package/dist/js/uikit.js +298 -139
  41. package/dist/js/uikit.min.js +1 -1
  42. package/package.json +1 -1
  43. package/src/js/components/parallax.js +15 -0
  44. package/src/js/core/accordion.js +3 -3
  45. package/src/js/core/alert.js +1 -1
  46. package/src/js/core/drop.js +40 -20
  47. package/src/js/core/height-viewport.js +14 -9
  48. package/src/js/core/navbar.js +19 -18
  49. package/src/js/core/scrollspy.js +4 -0
  50. package/src/js/core/toggle.js +5 -8
  51. package/src/js/mixin/parallax.js +54 -34
  52. package/src/js/mixin/position.js +44 -23
  53. package/src/js/mixin/togglable.js +105 -19
  54. package/src/js/util/animation.js +1 -0
  55. package/src/js/util/dom.js +4 -3
  56. package/src/js/util/viewport.js +1 -1
  57. package/src/less/components/drop.less +17 -4
  58. package/src/less/components/dropdown.less +19 -4
  59. package/src/less/components/margin.less +13 -14
  60. package/src/less/components/nav.less +1 -1
  61. package/src/less/components/navbar.less +32 -11
  62. package/src/less/components/position.less +1 -1
  63. package/src/less/components/sticky.less +7 -0
  64. package/src/less/components/utility.less +1 -2
  65. package/src/less/theme/dropdown.less +11 -0
  66. package/src/less/theme/navbar.less +7 -0
  67. package/src/scss/components/drop.scss +17 -4
  68. package/src/scss/components/dropdown.scss +19 -4
  69. package/src/scss/components/margin.scss +13 -14
  70. package/src/scss/components/nav.scss +1 -1
  71. package/src/scss/components/navbar.scss +21 -0
  72. package/src/scss/components/position.scss +1 -1
  73. package/src/scss/components/sticky.scss +7 -0
  74. package/src/scss/components/utility.scss +1 -2
  75. package/src/scss/mixins-theme.scss +8 -0
  76. package/src/scss/mixins.scss +2 -0
  77. package/src/scss/theme/dropdown.scss +8 -0
  78. package/src/scss/theme/navbar.scss +4 -0
  79. package/src/scss/variables-theme.scss +3 -0
  80. package/src/scss/variables.scss +1 -0
  81. package/tests/drop.html +145 -2
  82. package/tests/dropdown.html +228 -13
  83. package/tests/height-viewport.html +62 -0
  84. package/tests/navbar.html +321 -14
  85. package/tests/sticky-navbar.html +132 -0
  86. package/tests/sticky-parallax.html +2 -1
  87. package/tests/sticky.html +5 -4
@@ -5,13 +5,15 @@ import {
5
5
  css,
6
6
  fastdom,
7
7
  hasClass,
8
- height,
9
8
  includes,
10
9
  isBoolean,
11
10
  isFunction,
12
11
  isVisible,
13
12
  noop,
13
+ offset,
14
14
  removeClass,
15
+ scrollParents,
16
+ startsWith,
15
17
  toFloat,
16
18
  toggleClass,
17
19
  toNodes,
@@ -41,7 +43,7 @@ export default {
41
43
 
42
44
  initProps: {
43
45
  overflow: '',
44
- height: '',
46
+ maxHeight: '',
45
47
  paddingTop: '',
46
48
  paddingBottom: '',
47
49
  marginTop: '',
@@ -51,7 +53,7 @@ export default {
51
53
 
52
54
  hideProps: {
53
55
  overflow: 'hidden',
54
- height: 0,
56
+ maxHeight: 0,
55
57
  paddingTop: 0,
56
58
  paddingBottom: 0,
57
59
  marginTop: 0,
@@ -66,7 +68,7 @@ export default {
66
68
  },
67
69
 
68
70
  hasTransition({ animation }) {
69
- return this.hasAnimation && animation[0] === true;
71
+ return startsWith(animation[0], 'slide');
70
72
  },
71
73
  },
72
74
 
@@ -90,9 +92,9 @@ export default {
90
92
  isFunction(animate)
91
93
  ? animate
92
94
  : animate === false || !this.hasAnimation
93
- ? this._toggle
95
+ ? toggleInstant(this)
94
96
  : this.hasTransition
95
- ? toggleHeight(this)
97
+ ? toggleTransition(this)
96
98
  : toggleAnimation(this)
97
99
  )(el, show);
98
100
 
@@ -156,7 +158,25 @@ export default {
156
158
  },
157
159
  };
158
160
 
159
- export function toggleHeight({
161
+ function toggleInstant({ _toggle }) {
162
+ return (el, show) => {
163
+ Animation.cancel(el);
164
+ Transition.cancel(el);
165
+ return _toggle(el, show);
166
+ };
167
+ }
168
+
169
+ function toggleTransition(cmp) {
170
+ switch (cmp.animation[0]) {
171
+ case 'slide-left':
172
+ return slideHorizontal(cmp);
173
+ case 'slide-right':
174
+ return slideHorizontal(cmp, true);
175
+ }
176
+ return slide(cmp);
177
+ }
178
+
179
+ export function slide({
160
180
  isToggled,
161
181
  duration,
162
182
  velocity,
@@ -167,11 +187,14 @@ export function toggleHeight({
167
187
  }) {
168
188
  return (el, show) => {
169
189
  const inProgress = Transition.inProgress(el);
170
- const inner = el.hasChildNodes()
171
- ? toFloat(css(el.firstElementChild, 'marginTop')) +
172
- toFloat(css(el.lastElementChild, 'marginBottom'))
173
- : 0;
174
- const currentHeight = isVisible(el) ? height(el) + (inProgress ? 0 : inner) : 0;
190
+ const inner =
191
+ !inProgress && el.hasChildNodes()
192
+ ? toFloat(css(el.firstElementChild, 'marginTop')) +
193
+ toFloat(css(el.lastElementChild, 'marginBottom'))
194
+ : 0;
195
+ const currentHeight = isVisible(el) ? toFloat(css(el, 'height')) + inner : 0;
196
+
197
+ const props = inProgress ? css(el, Object.keys(initProps)) : show ? hideProps : initProps;
175
198
 
176
199
  Transition.cancel(el);
177
200
 
@@ -179,34 +202,97 @@ export function toggleHeight({
179
202
  _toggle(el, true);
180
203
  }
181
204
 
182
- height(el, '');
205
+ css(el, 'maxHeight', '');
183
206
 
184
207
  // Update child components first
185
208
  fastdom.flush();
186
209
 
187
- const endHeight = height(el) + (inProgress ? 0 : inner);
188
- duration = velocity * el.offsetHeight + duration;
210
+ const endHeight = toFloat(css(el, 'height')) + inner;
211
+ duration = velocity * endHeight + duration;
189
212
 
190
- height(el, currentHeight);
213
+ css(el, { ...props, maxHeight: currentHeight });
191
214
 
192
215
  return (
193
216
  show
194
217
  ? Transition.start(
195
218
  el,
196
- { ...initProps, overflow: 'hidden', height: endHeight },
197
- Math.round(duration * (1 - currentHeight / endHeight)),
219
+ { ...initProps, overflow: 'hidden', maxHeight: endHeight },
220
+ duration * (1 - currentHeight / endHeight),
198
221
  transition
199
222
  )
200
223
  : Transition.start(
201
224
  el,
202
225
  hideProps,
203
- Math.round(duration * (currentHeight / endHeight)),
226
+ duration * (currentHeight / endHeight),
204
227
  transition
205
228
  ).then(() => _toggle(el, false))
206
229
  ).then(() => css(el, initProps));
207
230
  };
208
231
  }
209
232
 
233
+ function slideHorizontal({ isToggled, duration, velocity, transition, _toggle }, right) {
234
+ return (el, show) => {
235
+ const visible = isVisible(el);
236
+ const marginLeft = toFloat(css(el, 'marginLeft'));
237
+
238
+ Transition.cancel(el);
239
+
240
+ const [scrollElement] = scrollParents(el);
241
+ css(scrollElement, 'overflowX', 'hidden');
242
+
243
+ if (!isToggled(el)) {
244
+ _toggle(el, true);
245
+ }
246
+
247
+ const width = toFloat(css(el, 'width'));
248
+ duration = velocity * width + duration;
249
+
250
+ const percent = visible ? ((width + marginLeft * (right ? -1 : 1)) / width) * 100 : 0;
251
+ const offsetEl = offset(el);
252
+ const useClipPath = right
253
+ ? offsetEl.right < scrollElement.clientWidth
254
+ : Math.round(offsetEl.left) > 0;
255
+
256
+ css(el, {
257
+ clipPath: useClipPath
258
+ ? right
259
+ ? `polygon(0 0,${percent}% 0,${percent}% 100%,0 100%)`
260
+ : `polygon(${100 - percent}% 0,100% 0,100% 100%,${100 - percent}% 100%)`
261
+ : '',
262
+ marginLeft: (((100 - percent) * (right ? 1 : -1)) / 100) * width,
263
+ });
264
+
265
+ return (
266
+ show
267
+ ? Transition.start(
268
+ el,
269
+ {
270
+ clipPath: useClipPath ? `polygon(0 0,100% 0,100% 100%,0 100%)` : '',
271
+ marginLeft: 0,
272
+ },
273
+ duration * (1 - percent / 100),
274
+ transition
275
+ )
276
+ : Transition.start(
277
+ el,
278
+ {
279
+ clipPath: useClipPath
280
+ ? right
281
+ ? `polygon(0 0,0 0,0 100%,0 100%)`
282
+ : `polygon(100% 0,100% 0,100% 100%,100% 100%)`
283
+ : '',
284
+ marginLeft: (right ? 1 : -1) * width,
285
+ },
286
+ duration * (percent / 100),
287
+ transition
288
+ ).then(() => _toggle(el, false))
289
+ ).then(() => {
290
+ css(scrollElement, 'overflowX', '');
291
+ css(el, { clipPath: '', marginLeft: '' });
292
+ });
293
+ };
294
+ }
295
+
210
296
  function toggleAnimation(cmp) {
211
297
  return (el, show) => {
212
298
  Animation.cancel(el);
@@ -5,6 +5,7 @@ import { startsWith, toNodes } from './lang';
5
5
  import { addClass, hasClass, removeClass, removeClasses } from './class';
6
6
 
7
7
  export function transition(element, props, duration = 400, timing = 'linear') {
8
+ duration = Math.round(duration);
8
9
  return Promise.all(
9
10
  toNodes(element).map(
10
11
  (element) =>
@@ -17,14 +17,15 @@ export function isTag(element, tagName) {
17
17
  }
18
18
 
19
19
  export function empty(element) {
20
- return replaceChildren(element, '');
20
+ element = $(element);
21
+ element.innerHTML = '';
22
+ return element;
21
23
  }
22
24
 
23
25
  export function html(parent, html) {
24
- return isUndefined(html) ? $(parent).innerHTML : replaceChildren(parent, html);
26
+ return isUndefined(html) ? $(parent).innerHTML : append(empty(parent), html);
25
27
  }
26
28
 
27
- export const replaceChildren = applyFn('replaceChildren');
28
29
  export const prepend = applyFn('prepend');
29
30
  export const append = applyFn('append');
30
31
  export const before = applyFn('before');
@@ -128,7 +128,7 @@ export function scrolledOver(element, startOffset = 0, endOffset = 0) {
128
128
  return clamp((scrollTop - start) / (end - start));
129
129
  }
130
130
 
131
- export function scrollParents(element, overflowRe = /auto|scroll|hidden/, scrollable = false) {
131
+ export function scrollParents(element, overflowRe = /auto|scroll|hidden|clip/, scrollable = false) {
132
132
  const scrollEl = scrollingElement(element);
133
133
 
134
134
  let ancestors = parents(element).reverse();
@@ -3,10 +3,7 @@
3
3
  //
4
4
  // Component: `uk-drop`
5
5
  //
6
- // Modifiers: `uk-drop-top-*`
7
- // `uk-drop-bottom-*`
8
- // `uk-drop-left-*`
9
- // `uk-drop-right-*`
6
+ // Modifiers: `uk-drop-stretch`
10
7
  // `uk-drop-stack`
11
8
  // `uk-drop-grid`
12
9
  //
@@ -53,6 +50,22 @@
53
50
  .uk-drop.uk-open { display: block; }
54
51
 
55
52
 
53
+ /* Stretch modifier
54
+ ========================================================================== */
55
+
56
+ /*
57
+ * 1. Allow scrolling
58
+ */
59
+
60
+ .uk-drop-stretch {
61
+ --uk-position-offset: 0;
62
+ --uk-position-viewport-offset: 0;
63
+ /* 1 */
64
+ overflow-y: auto;
65
+ -webkit-overflow-scrolling: touch;
66
+ }
67
+
68
+
56
69
  /* Grid modifiers
57
70
  ========================================================================== */
58
71
 
@@ -5,10 +5,7 @@
5
5
  //
6
6
  // Adopted: `uk-dropdown-nav`
7
7
  //
8
- // Modifiers: `uk-dropdown-top-*`
9
- // `uk-dropdown-bottom-*`
10
- // `uk-dropdown-left-*`
11
- // `uk-dropdown-right-*`
8
+ // Modifiers: `uk-dropdown-stretch`
12
9
  // `uk-dropdown-stack`
13
10
  // `uk-dropdown-grid`
14
11
  //
@@ -72,6 +69,23 @@
72
69
  .uk-dropdown.uk-open { display: block; }
73
70
 
74
71
 
72
+ /* Stretch modifier
73
+ ========================================================================== */
74
+
75
+ /*
76
+ * 1. Allow scrolling
77
+ */
78
+
79
+ .uk-dropdown-stretch {
80
+ --uk-position-offset: 0;
81
+ --uk-position-viewport-offset: 0;
82
+ /* 1 */
83
+ overflow-y: auto;
84
+ -webkit-overflow-scrolling: touch;
85
+ .hook-dropdown-stretch();
86
+ }
87
+
88
+
75
89
  /* Nav
76
90
  * Adopts `uk-nav`
77
91
  ========================================================================== */
@@ -146,6 +160,7 @@
146
160
  .hook-dropdown-misc();
147
161
 
148
162
  .hook-dropdown() {}
163
+ .hook-dropdown-stretch() {}
149
164
  .hook-dropdown-nav() {}
150
165
  .hook-dropdown-nav-item() {}
151
166
  .hook-dropdown-nav-item-hover() {}
@@ -193,20 +193,20 @@
193
193
  /* Remove
194
194
  ========================================================================== */
195
195
 
196
- .uk-margin-remove { margin: 0 !important; }
197
- .uk-margin-remove-top { margin-top: 0 !important; }
198
- .uk-margin-remove-bottom { margin-bottom: 0 !important; }
199
- .uk-margin-remove-left { margin-left: 0 !important; }
200
- .uk-margin-remove-right { margin-right: 0 !important; }
201
-
202
- .uk-margin-remove-vertical {
203
- margin-top: 0 !important;
204
- margin-bottom: 0 !important;
205
- }
196
+ .uk-margin-remove { margin: 0 !important; }
197
+ .uk-margin-remove-top { margin-top: 0 !important; }
198
+ .uk-margin-remove-bottom { margin-bottom: 0 !important; }
199
+ .uk-margin-remove-left { margin-left: 0 !important; }
200
+ .uk-margin-remove-right { margin-right: 0 !important; }
201
+
202
+ .uk-margin-remove-vertical {
203
+ margin-top: 0 !important;
204
+ margin-bottom: 0 !important;
205
+ }
206
206
 
207
- .uk-margin-remove-adjacent + *,
208
- .uk-margin-remove-first-child > :first-child { margin-top: 0 !important; }
209
- .uk-margin-remove-last-child > :last-child { margin-bottom: 0 !important; }
207
+ .uk-margin-remove-adjacent + *,
208
+ .uk-margin-remove-first-child > :first-child { margin-top: 0 !important; }
209
+ .uk-margin-remove-last-child > :last-child { margin-bottom: 0 !important; }
210
210
 
211
211
  /* Phone landscape and bigger */
212
212
  @media (min-width: @breakpoint-small) {
@@ -241,7 +241,6 @@
241
241
  }
242
242
 
243
243
 
244
-
245
244
  // Hooks
246
245
  // ========================================================================
247
246
 
@@ -282,7 +282,7 @@ ul.uk-nav-sub {
282
282
  * Subtitle
283
283
  */
284
284
 
285
- .uk-nav-primary .uk-nav-subtitle {
285
+ .uk-nav-primary .uk-nav-subtitle {
286
286
  font-size: @nav-primary-subtitle-font-size;
287
287
  .hook-nav-primary-subtitle();
288
288
  }
@@ -65,6 +65,7 @@
65
65
  @navbar-dropdown-padding: 15px;
66
66
  @navbar-dropdown-background: @global-muted-background;
67
67
  @navbar-dropdown-color: @global-color;
68
+ @navbar-dropdown-color-mode: none;
68
69
  @navbar-dropdown-grid-gutter-horizontal: @global-gutter;
69
70
  @navbar-dropdown-grid-gutter-vertical: @navbar-dropdown-grid-gutter-horizontal;
70
71
 
@@ -392,6 +393,10 @@
392
393
  /* Show */
393
394
  .uk-navbar-dropdown.uk-open { display: block; }
394
395
 
396
+
397
+ .uk-navbar-dropdown:extend(.uk-light all) when (@navbar-dropdown-color-mode = light) {}
398
+ .uk-navbar-dropdown:extend(.uk-dark all) when (@navbar-dropdown-color-mode = dark) {}
399
+
395
400
  /*
396
401
  * Grid
397
402
  * Adopts `uk-grid`
@@ -416,6 +421,21 @@
416
421
  .uk-navbar-dropdown-width-4:not(.uk-navbar-dropdown-stack) { width: (@navbar-dropdown-width * 4); }
417
422
  .uk-navbar-dropdown-width-5:not(.uk-navbar-dropdown-stack) { width: (@navbar-dropdown-width * 5); }
418
423
 
424
+ /*
425
+ * Stretch modifier
426
+ * 1. Allow scrolling
427
+ */
428
+
429
+ .uk-navbar-dropdown-stretch {
430
+ --uk-position-offset: 0;
431
+ --uk-position-shift-offset: 0;
432
+ --uk-position-viewport-offset: 0;
433
+ /* 1 */
434
+ overflow-y: auto;
435
+ -webkit-overflow-scrolling: touch;
436
+ .hook-navbar-dropdown-stretch();
437
+ }
438
+
419
439
  /*
420
440
  * Dropbar modifier
421
441
  * 1. Reset dropdown width to prevent to early shifting
@@ -531,24 +551,25 @@
531
551
  .hook-navbar-nav-item-onclick() {}
532
552
  .hook-navbar-nav-item-active() {}
533
553
  .hook-navbar-item() {}
534
- .hook-navbar-toggle(){}
535
- .hook-navbar-toggle-hover(){}
536
- .hook-navbar-toggle-icon(){}
537
- .hook-navbar-toggle-icon-hover(){}
554
+ .hook-navbar-toggle() {}
555
+ .hook-navbar-toggle-hover() {}
556
+ .hook-navbar-toggle-icon() {}
557
+ .hook-navbar-toggle-icon-hover() {}
538
558
  .hook-navbar-subtitle() {}
539
- .hook-navbar-primary(){}
540
- .hook-navbar-transparent(){}
541
- .hook-navbar-sticky(){}
542
- .hook-navbar-dropdown(){}
543
- .hook-navbar-dropdown-dropbar(){}
544
- .hook-navbar-dropdown-nav(){}
559
+ .hook-navbar-primary() {}
560
+ .hook-navbar-transparent() {}
561
+ .hook-navbar-sticky() {}
562
+ .hook-navbar-dropdown() {}
563
+ .hook-navbar-dropdown-stretch() {}
564
+ .hook-navbar-dropdown-dropbar() {}
565
+ .hook-navbar-dropdown-nav() {}
545
566
  .hook-navbar-dropdown-nav-item() {}
546
567
  .hook-navbar-dropdown-nav-item-hover() {}
547
568
  .hook-navbar-dropdown-nav-item-active() {}
548
569
  .hook-navbar-dropdown-nav-subtitle() {}
549
570
  .hook-navbar-dropdown-nav-header() {}
550
571
  .hook-navbar-dropdown-nav-divider() {}
551
- .hook-navbar-dropbar(){}
572
+ .hook-navbar-dropbar() {}
552
573
  .hook-navbar-misc() {}
553
574
 
554
575
 
@@ -218,7 +218,7 @@
218
218
  ========================================================================== */
219
219
 
220
220
  .uk-position-z-index { z-index: 1; }
221
-
221
+ .uk-position-z-index-zero { z-index: 0; }
222
222
  .uk-position-z-index-negative { z-index: -1; }
223
223
 
224
224
 
@@ -55,6 +55,13 @@
55
55
 
56
56
  .uk-sticky.uk-animation-reverse { animation-duration: @sticky-reverse-animation-duration; }
57
57
 
58
+ /*
59
+ * Placeholder
60
+ * Make content clickable for sticky cover and reveal effects
61
+ */
62
+
63
+ .uk-sticky-placeholder { pointer-events: none; }
64
+
58
65
 
59
66
  // Hooks
60
67
  // ========================================================================
@@ -137,7 +137,6 @@
137
137
 
138
138
  /*
139
139
  * Enable scrollbars if content is clipped
140
- * Note: Firefox ignores `padding-bottom` for the scrollable overflow https://bugzilla.mozilla.org/show_bug.cgi?id=748518
141
140
  */
142
141
 
143
142
  .uk-overflow-auto {
@@ -405,7 +404,7 @@
405
404
  .hook-logo-hover();
406
405
  }
407
406
 
408
- .uk-logo > :where(img, svg, video) { display: block; }
407
+ .uk-logo > :where(img, svg, video) { display: inline-block; }
409
408
 
410
409
  .uk-logo-inverse { display: none; }
411
410
 
@@ -20,6 +20,8 @@
20
20
 
21
21
  @dropdown-box-shadow: 0 5px 12px rgba(0,0,0,0.15);
22
22
 
23
+ @dropdown-stretch-background: @global-muted-background;
24
+
23
25
 
24
26
  // Component
25
27
  // ========================================================================
@@ -27,6 +29,15 @@
27
29
  .hook-dropdown() { box-shadow: @dropdown-box-shadow; }
28
30
 
29
31
 
32
+ // Stretch modifier
33
+ // ========================================================================
34
+
35
+ .hook-dropdown-stretch() {
36
+ box-shadow: none;
37
+ background: @dropdown-stretch-background;
38
+ }
39
+
40
+
30
41
  // Nav
31
42
  // ========================================================================
32
43
 
@@ -29,6 +29,8 @@
29
29
 
30
30
  @navbar-dropdown-box-shadow: 0 5px 12px rgba(0,0,0,0.15);
31
31
 
32
+ @navbar-dropdown-stretch-background: @global-muted-background;
33
+
32
34
  @navbar-dropbar-box-shadow: 0 5px 7px rgba(0, 0, 0, 0.05);
33
35
 
34
36
  @navbar-dropdown-grid-divider-border-width: @global-border-width;
@@ -102,6 +104,11 @@
102
104
 
103
105
  .hook-navbar-dropdown() { box-shadow: @navbar-dropdown-box-shadow; }
104
106
 
107
+ .hook-navbar-dropdown-stretch() {
108
+ box-shadow: none;
109
+ background: @navbar-dropdown-stretch-background;
110
+ }
111
+
105
112
  .hook-navbar-dropdown-dropbar() { box-shadow: none; }
106
113
 
107
114
 
@@ -3,10 +3,7 @@
3
3
  //
4
4
  // Component: `uk-drop`
5
5
  //
6
- // Modifiers: `uk-drop-top-*`
7
- // `uk-drop-bottom-*`
8
- // `uk-drop-left-*`
9
- // `uk-drop-right-*`
6
+ // Modifiers: `uk-drop-stretch`
10
7
  // `uk-drop-stack`
11
8
  // `uk-drop-grid`
12
9
  //
@@ -53,6 +50,22 @@ $drop-width: 300px !default;
53
50
  .uk-drop.uk-open { display: block; }
54
51
 
55
52
 
53
+ /* Stretch modifier
54
+ ========================================================================== */
55
+
56
+ /*
57
+ * 1. Allow scrolling
58
+ */
59
+
60
+ .uk-drop-stretch {
61
+ --uk-position-offset: 0;
62
+ --uk-position-viewport-offset: 0;
63
+ /* 1 */
64
+ overflow-y: auto;
65
+ -webkit-overflow-scrolling: touch;
66
+ }
67
+
68
+
56
69
  /* Grid modifiers
57
70
  ========================================================================== */
58
71
 
@@ -5,10 +5,7 @@
5
5
  //
6
6
  // Adopted: `uk-dropdown-nav`
7
7
  //
8
- // Modifiers: `uk-dropdown-top-*`
9
- // `uk-dropdown-bottom-*`
10
- // `uk-dropdown-left-*`
11
- // `uk-dropdown-right-*`
8
+ // Modifiers: `uk-dropdown-stretch`
12
9
  // `uk-dropdown-stack`
13
10
  // `uk-dropdown-grid`
14
11
  //
@@ -72,6 +69,23 @@ $dropdown-nav-sublist-item-hover-color: $global-color !default;
72
69
  .uk-dropdown.uk-open { display: block; }
73
70
 
74
71
 
72
+ /* Stretch modifier
73
+ ========================================================================== */
74
+
75
+ /*
76
+ * 1. Allow scrolling
77
+ */
78
+
79
+ .uk-dropdown-stretch {
80
+ --uk-position-offset: 0;
81
+ --uk-position-viewport-offset: 0;
82
+ /* 1 */
83
+ overflow-y: auto;
84
+ -webkit-overflow-scrolling: touch;
85
+ @if(mixin-exists(hook-dropdown-stretch)) {@include hook-dropdown-stretch();}
86
+ }
87
+
88
+
75
89
  /* Nav
76
90
  * Adopts `uk-nav`
77
91
  ========================================================================== */
@@ -146,6 +160,7 @@ $dropdown-nav-sublist-item-hover-color: $global-color !default;
146
160
  @if(mixin-exists(hook-dropdown-misc)) {@include hook-dropdown-misc();}
147
161
 
148
162
  // @mixin hook-dropdown(){}
163
+ // @mixin hook-dropdown-stretch(){}
149
164
  // @mixin hook-dropdown-nav(){}
150
165
  // @mixin hook-dropdown-nav-item(){}
151
166
  // @mixin hook-dropdown-nav-item-hover(){}
@@ -193,20 +193,20 @@ $margin-xlarge-margin-l: $global-xlarge-margin !d
193
193
  /* Remove
194
194
  ========================================================================== */
195
195
 
196
- .uk-margin-remove { margin: 0 !important; }
197
- .uk-margin-remove-top { margin-top: 0 !important; }
198
- .uk-margin-remove-bottom { margin-bottom: 0 !important; }
199
- .uk-margin-remove-left { margin-left: 0 !important; }
200
- .uk-margin-remove-right { margin-right: 0 !important; }
201
-
202
- .uk-margin-remove-vertical {
203
- margin-top: 0 !important;
204
- margin-bottom: 0 !important;
205
- }
196
+ .uk-margin-remove { margin: 0 !important; }
197
+ .uk-margin-remove-top { margin-top: 0 !important; }
198
+ .uk-margin-remove-bottom { margin-bottom: 0 !important; }
199
+ .uk-margin-remove-left { margin-left: 0 !important; }
200
+ .uk-margin-remove-right { margin-right: 0 !important; }
201
+
202
+ .uk-margin-remove-vertical {
203
+ margin-top: 0 !important;
204
+ margin-bottom: 0 !important;
205
+ }
206
206
 
207
- .uk-margin-remove-adjacent + *,
208
- .uk-margin-remove-first-child > :first-child { margin-top: 0 !important; }
209
- .uk-margin-remove-last-child > :last-child { margin-bottom: 0 !important; }
207
+ .uk-margin-remove-adjacent + *,
208
+ .uk-margin-remove-first-child > :first-child { margin-top: 0 !important; }
209
+ .uk-margin-remove-last-child > :last-child { margin-bottom: 0 !important; }
210
210
 
211
211
  /* Phone landscape and bigger */
212
212
  @media (min-width: $breakpoint-small) {
@@ -241,7 +241,6 @@ $margin-xlarge-margin-l: $global-xlarge-margin !d
241
241
  }
242
242
 
243
243
 
244
-
245
244
  // Hooks
246
245
  // ========================================================================
247
246
 
@@ -282,7 +282,7 @@ ul.uk-nav-sub {
282
282
  * Subtitle
283
283
  */
284
284
 
285
- .uk-nav-primary .uk-nav-subtitle {
285
+ .uk-nav-primary .uk-nav-subtitle {
286
286
  font-size: $nav-primary-subtitle-font-size;
287
287
  @if(mixin-exists(hook-nav-primary-subtitle)) {@include hook-nav-primary-subtitle();}
288
288
  }