uikit 3.14.4-dev.fea9fd466 → 3.15.1-dev.f849bb0c8
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.
- package/CHANGELOG.md +32 -18
- package/build/util.js +1 -0
- package/dist/css/uikit-core-rtl.css +284 -63
- package/dist/css/uikit-core-rtl.min.css +1 -1
- package/dist/css/uikit-core.css +284 -63
- package/dist/css/uikit-core.min.css +1 -1
- package/dist/css/uikit-rtl.css +306 -92
- package/dist/css/uikit-rtl.min.css +1 -1
- package/dist/css/uikit.css +306 -92
- package/dist/css/uikit.min.css +1 -1
- package/dist/js/components/countdown.js +1 -1
- package/dist/js/components/countdown.min.js +1 -1
- package/dist/js/components/filter.js +1 -1
- package/dist/js/components/filter.min.js +1 -1
- package/dist/js/components/lightbox-panel.js +98 -131
- package/dist/js/components/lightbox-panel.min.js +1 -1
- package/dist/js/components/lightbox.js +98 -131
- package/dist/js/components/lightbox.min.js +1 -1
- package/dist/js/components/notification.js +4 -2
- package/dist/js/components/notification.min.js +1 -1
- package/dist/js/components/parallax.js +1 -1
- package/dist/js/components/parallax.min.js +1 -1
- package/dist/js/components/slider-parallax.js +1 -1
- package/dist/js/components/slider-parallax.min.js +1 -1
- package/dist/js/components/slider.js +1 -1
- package/dist/js/components/slider.min.js +1 -1
- package/dist/js/components/slideshow-parallax.js +1 -1
- package/dist/js/components/slideshow-parallax.min.js +1 -1
- package/dist/js/components/slideshow.js +1 -1
- package/dist/js/components/slideshow.min.js +1 -1
- package/dist/js/components/sortable.js +1 -1
- package/dist/js/components/sortable.min.js +1 -1
- package/dist/js/components/tooltip.js +101 -136
- package/dist/js/components/tooltip.min.js +1 -1
- package/dist/js/components/upload.js +1 -1
- package/dist/js/components/upload.min.js +1 -1
- package/dist/js/uikit-core.js +518 -478
- package/dist/js/uikit-core.min.js +17 -1
- package/dist/js/uikit-icons.js +1 -1
- package/dist/js/uikit-icons.min.js +1 -1
- package/dist/js/uikit.js +521 -479
- package/dist/js/uikit.min.js +17 -1
- package/package.json +11 -11
- package/src/images/components/navbar-toggle-icon.svg +25 -3
- package/src/js/api/hooks.js +5 -1
- package/src/js/api/state.js +2 -2
- package/src/js/components/notification.js +3 -1
- package/src/js/core/accordion.js +9 -17
- package/src/js/core/alert.js +35 -14
- package/src/js/core/drop.js +110 -82
- package/src/js/core/navbar.js +33 -49
- package/src/js/core/offcanvas.js +8 -4
- package/src/js/core/scroll.js +37 -10
- package/src/js/core/toggle.js +3 -5
- package/src/js/mixin/modal.js +15 -12
- package/src/js/mixin/position.js +21 -22
- package/src/js/mixin/style.js +11 -0
- package/src/js/mixin/togglable.js +90 -124
- package/src/js/util/animation.js +9 -7
- package/src/js/util/class.js +3 -1
- package/src/js/util/filter.js +3 -7
- package/src/js/util/position.js +136 -130
- package/src/js/util/viewport.js +1 -1
- package/src/less/components/_import.less +1 -0
- package/src/less/components/drop.less +1 -18
- package/src/less/components/dropbar.less +126 -0
- package/src/less/components/dropdown.less +6 -20
- package/src/less/components/nav.less +214 -23
- package/src/less/components/navbar.less +26 -54
- package/src/less/theme/_import.less +1 -0
- package/src/less/theme/dropbar.less +44 -0
- package/src/less/theme/dropdown.less +0 -11
- package/src/less/theme/nav.less +46 -0
- package/src/less/theme/navbar.less +5 -36
- package/src/scss/components/_import.scss +1 -0
- package/src/scss/components/drop.scss +1 -18
- package/src/scss/components/dropbar.scss +126 -0
- package/src/scss/components/dropdown.scss +6 -20
- package/src/scss/components/nav.scss +163 -22
- package/src/scss/components/navbar.scss +26 -54
- package/src/scss/mixins-theme.scss +81 -35
- package/src/scss/mixins.scss +77 -3
- package/src/scss/theme/_import.scss +1 -0
- package/src/scss/theme/dropbar.scss +44 -0
- package/src/scss/theme/dropdown.scss +0 -8
- package/src/scss/theme/nav.scss +44 -0
- package/src/scss/theme/navbar.scss +4 -8
- package/src/scss/variables-theme.scss +58 -13
- package/src/scss/variables.scss +46 -8
- package/tests/accordion.html +2 -2
- package/tests/alert.html +2 -2
- package/tests/countdown.html +1 -1
- package/tests/drop.html +446 -416
- package/tests/dropbar.html +458 -0
- package/tests/dropdown.html +8 -470
- package/tests/filter.html +9 -12
- package/tests/flex.html +36 -36
- package/tests/form.html +1 -1
- package/tests/grid.html +22 -22
- package/tests/height.html +6 -6
- package/tests/index.html +127 -108
- package/tests/js/index.js +1 -4
- package/tests/lightbox.html +5 -5
- package/tests/list.html +8 -8
- package/tests/modal.html +13 -13
- package/tests/nav.html +121 -12
- package/tests/navbar.html +111 -220
- package/tests/offcanvas.html +10 -14
- package/tests/pagination.html +6 -6
- package/tests/parallax.html +1 -1
- package/tests/position.html +18 -16
- package/tests/progress.html +9 -9
- package/tests/scroll.html +7 -10
- package/tests/search.html +6 -6
- package/tests/slider.html +6 -5
- package/tests/slideshow.html +8 -8
- package/tests/sortable.html +6 -8
- package/tests/sticky-navbar.html +15 -15
- package/tests/sticky.html +8 -8
- package/tests/switcher.html +1 -1
- package/tests/tab.html +1 -1
- package/tests/table.html +7 -7
- package/tests/toggle.html +2 -2
- package/tests/tooltip.html +1 -1
- package/tests/upload.html +11 -11
- package/tests/utility.html +16 -16
package/src/js/util/position.js
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { offset } from './dimensions';
|
|
2
|
-
import { clamp,
|
|
2
|
+
import { clamp, isArray, ucfirst } from './lang';
|
|
3
3
|
import { offsetViewport, scrollParents } from './viewport';
|
|
4
4
|
|
|
5
5
|
const dirs = [
|
|
@@ -15,127 +15,47 @@ export function positionAt(element, target, options) {
|
|
|
15
15
|
...options.attach,
|
|
16
16
|
},
|
|
17
17
|
offset: [0, 0],
|
|
18
|
+
placement: [],
|
|
18
19
|
...options,
|
|
19
20
|
};
|
|
20
21
|
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
: attachTo(element, target, options);
|
|
24
|
-
|
|
25
|
-
offset(element, dim);
|
|
26
|
-
}
|
|
27
|
-
|
|
28
|
-
function attachTo(element, target, options) {
|
|
29
|
-
let { attach, offset: offsetBy } = {
|
|
30
|
-
attach: {
|
|
31
|
-
element: ['left', 'top'],
|
|
32
|
-
target: ['left', 'top'],
|
|
33
|
-
...options.attach,
|
|
34
|
-
},
|
|
35
|
-
offset: [0, 0],
|
|
36
|
-
...options,
|
|
37
|
-
};
|
|
38
|
-
|
|
39
|
-
const position = offset(element);
|
|
40
|
-
const targetOffset = offset(target);
|
|
41
|
-
for (const [i, [prop, dir, start, end]] of Object.entries(dirs)) {
|
|
42
|
-
position[start] = position[dir] =
|
|
43
|
-
targetOffset[start] +
|
|
44
|
-
moveBy(attach.target[i], end, targetOffset[prop]) -
|
|
45
|
-
moveBy(attach.element[i], end, position[prop]) +
|
|
46
|
-
+offsetBy[i];
|
|
47
|
-
position[end] = position[start] + position[prop];
|
|
22
|
+
if (!isArray(target)) {
|
|
23
|
+
target = [target, target];
|
|
48
24
|
}
|
|
49
|
-
return position;
|
|
50
|
-
}
|
|
51
25
|
|
|
52
|
-
|
|
53
|
-
return start === 'center' ? dim / 2 : start === end ? dim : 0;
|
|
26
|
+
offset(element, getPosition(element, target, options));
|
|
54
27
|
}
|
|
55
28
|
|
|
56
|
-
function
|
|
29
|
+
function getPosition(element, target, options) {
|
|
57
30
|
const position = attachTo(element, target, options);
|
|
58
|
-
const
|
|
59
|
-
|
|
60
|
-
let {
|
|
61
|
-
flip,
|
|
62
|
-
attach: { element: elAttach, target: targetAttach },
|
|
63
|
-
offset: elOffset,
|
|
64
|
-
boundary,
|
|
65
|
-
viewport,
|
|
66
|
-
viewportOffset,
|
|
67
|
-
} = options;
|
|
68
|
-
|
|
69
|
-
let viewports = scrollParents(element);
|
|
70
|
-
if (boundary === target) {
|
|
71
|
-
viewports = viewports.filter((viewport) => viewport !== boundary);
|
|
72
|
-
}
|
|
73
|
-
const [scrollElement] = viewports;
|
|
74
|
-
viewports.push(viewport);
|
|
31
|
+
const { boundary, viewportOffset = 0, placement } = options;
|
|
75
32
|
|
|
76
|
-
|
|
77
|
-
for (const [i, [prop,
|
|
78
|
-
|
|
79
|
-
continue;
|
|
80
|
-
}
|
|
33
|
+
let offsetPosition = position;
|
|
34
|
+
for (const [i, [prop, , start, end]] of Object.entries(dirs)) {
|
|
35
|
+
const viewport = getViewport(target[i], viewportOffset, boundary, i);
|
|
81
36
|
|
|
82
|
-
|
|
83
|
-
!intersectLine(position, targetDim, i) && intersectLine(position, targetDim, 1 - i);
|
|
84
|
-
|
|
85
|
-
viewport = getIntersectionArea(...viewports.filter(Boolean).map(offsetViewport));
|
|
86
|
-
|
|
87
|
-
if (viewportOffset) {
|
|
88
|
-
viewport[start] += viewportOffset;
|
|
89
|
-
viewport[end] -= viewportOffset;
|
|
90
|
-
}
|
|
91
|
-
|
|
92
|
-
if (boundary && !willFlip && position[prop] <= offset(boundary)[prop]) {
|
|
93
|
-
viewport = getIntersectionArea(viewport, offset(boundary));
|
|
94
|
-
}
|
|
95
|
-
|
|
96
|
-
const isInStartBoundary = position[start] >= viewport[start];
|
|
97
|
-
const isInEndBoundary = position[end] <= viewport[end];
|
|
98
|
-
|
|
99
|
-
if (isInStartBoundary && isInEndBoundary) {
|
|
37
|
+
if (isWithin(position, viewport, i)) {
|
|
100
38
|
continue;
|
|
101
39
|
}
|
|
102
40
|
|
|
103
|
-
let offsetBy;
|
|
41
|
+
let offsetBy = 0;
|
|
104
42
|
|
|
105
43
|
// Flip
|
|
106
|
-
if (
|
|
44
|
+
if (placement[i] === 'flip') {
|
|
45
|
+
const attach = options.attach.target[i];
|
|
107
46
|
if (
|
|
108
|
-
(
|
|
109
|
-
(
|
|
47
|
+
(attach === end && position[end] <= viewport[end]) ||
|
|
48
|
+
(attach === start && position[start] >= viewport[start])
|
|
110
49
|
) {
|
|
111
50
|
continue;
|
|
112
51
|
}
|
|
113
52
|
|
|
114
|
-
offsetBy =
|
|
115
|
-
(elAttach[i] === start
|
|
116
|
-
? -position[prop]
|
|
117
|
-
: elAttach[i] === end
|
|
118
|
-
? position[prop]
|
|
119
|
-
: 0) +
|
|
120
|
-
(targetAttach[i] === start
|
|
121
|
-
? targetDim[prop]
|
|
122
|
-
: targetAttach[i] === end
|
|
123
|
-
? -targetDim[prop]
|
|
124
|
-
: 0) -
|
|
125
|
-
elOffset[i] * 2;
|
|
53
|
+
offsetBy = flip(element, target, options, i)[start] - position[start];
|
|
126
54
|
|
|
127
|
-
|
|
128
|
-
|
|
129
|
-
|
|
130
|
-
|
|
131
|
-
[start]: position[start] + offsetBy,
|
|
132
|
-
[end]: position[end] + offsetBy,
|
|
133
|
-
},
|
|
134
|
-
scrollElement,
|
|
135
|
-
i
|
|
136
|
-
)
|
|
137
|
-
) {
|
|
138
|
-
if (isInScrollArea(position, scrollElement, i)) {
|
|
55
|
+
const scrollArea = getScrollArea(target[i], viewportOffset, i);
|
|
56
|
+
|
|
57
|
+
if (!isWithin(applyOffset(position, offsetBy, i), scrollArea, i)) {
|
|
58
|
+
if (isWithin(position, scrollArea, i)) {
|
|
139
59
|
continue;
|
|
140
60
|
}
|
|
141
61
|
|
|
@@ -143,27 +63,19 @@ function attachToWithFlip(element, target, options) {
|
|
|
143
63
|
return false;
|
|
144
64
|
}
|
|
145
65
|
|
|
146
|
-
|
|
147
|
-
|
|
148
|
-
|
|
149
|
-
|
|
150
|
-
element: elAttach.map(flipDir).reverse(),
|
|
151
|
-
target: targetAttach.map(flipDir).reverse(),
|
|
152
|
-
},
|
|
153
|
-
offset: elOffset.reverse(),
|
|
154
|
-
flip: flip === true ? flip : [...flip, dirs[1 - i][1]],
|
|
155
|
-
recursion: true,
|
|
156
|
-
});
|
|
157
|
-
|
|
158
|
-
if (newPos && isInScrollArea(newPos, scrollElement, 1 - i)) {
|
|
159
|
-
return newPos;
|
|
160
|
-
}
|
|
66
|
+
const newPos = flipAxis(element, target, options);
|
|
67
|
+
|
|
68
|
+
if (newPos && isWithin(newPos, scrollArea, 1 - i)) {
|
|
69
|
+
return newPos;
|
|
161
70
|
}
|
|
71
|
+
|
|
162
72
|
continue;
|
|
163
73
|
}
|
|
164
74
|
|
|
165
|
-
//
|
|
166
|
-
} else {
|
|
75
|
+
// Shift
|
|
76
|
+
} else if (placement[i] === 'shift') {
|
|
77
|
+
const targetDim = offset(target[i]);
|
|
78
|
+
const { offset: elOffset } = options;
|
|
167
79
|
offsetBy =
|
|
168
80
|
clamp(
|
|
169
81
|
clamp(position[start], viewport[start], viewport[end] - position[prop]),
|
|
@@ -172,13 +84,78 @@ function attachToWithFlip(element, target, options) {
|
|
|
172
84
|
) - position[start];
|
|
173
85
|
}
|
|
174
86
|
|
|
175
|
-
offsetPosition
|
|
176
|
-
offsetPosition[end] += offsetBy;
|
|
87
|
+
offsetPosition = applyOffset(offsetPosition, offsetBy, i);
|
|
177
88
|
}
|
|
178
89
|
|
|
179
90
|
return offsetPosition;
|
|
180
91
|
}
|
|
181
92
|
|
|
93
|
+
function attachTo(element, target, options) {
|
|
94
|
+
let { attach, offset: offsetBy } = {
|
|
95
|
+
attach: {
|
|
96
|
+
element: ['left', 'top'],
|
|
97
|
+
target: ['left', 'top'],
|
|
98
|
+
...options.attach,
|
|
99
|
+
},
|
|
100
|
+
offset: [0, 0],
|
|
101
|
+
...options,
|
|
102
|
+
};
|
|
103
|
+
|
|
104
|
+
let elOffset = offset(element);
|
|
105
|
+
|
|
106
|
+
for (const [i, [prop, , start, end]] of Object.entries(dirs)) {
|
|
107
|
+
const targetOffset =
|
|
108
|
+
attach.target[i] === attach.element[i] ? offsetViewport(target[i]) : offset(target[i]);
|
|
109
|
+
|
|
110
|
+
elOffset = applyOffset(
|
|
111
|
+
elOffset,
|
|
112
|
+
targetOffset[start] -
|
|
113
|
+
elOffset[start] +
|
|
114
|
+
moveBy(attach.target[i], end, targetOffset[prop]) -
|
|
115
|
+
moveBy(attach.element[i], end, elOffset[prop]) +
|
|
116
|
+
+offsetBy[i],
|
|
117
|
+
i
|
|
118
|
+
);
|
|
119
|
+
}
|
|
120
|
+
return elOffset;
|
|
121
|
+
}
|
|
122
|
+
|
|
123
|
+
function applyOffset(position, offset, i) {
|
|
124
|
+
const [, dir, start, end] = dirs[i];
|
|
125
|
+
const newPos = { ...position };
|
|
126
|
+
newPos[start] = position[dir] = position[start] + offset;
|
|
127
|
+
newPos[end] += offset;
|
|
128
|
+
return newPos;
|
|
129
|
+
}
|
|
130
|
+
|
|
131
|
+
function moveBy(attach, end, dim) {
|
|
132
|
+
return attach === 'center' ? dim / 2 : attach === end ? dim : 0;
|
|
133
|
+
}
|
|
134
|
+
|
|
135
|
+
function getViewport(element, viewportOffset, boundary, i) {
|
|
136
|
+
let viewport = getIntersectionArea(...scrollParents(element).map(offsetViewport));
|
|
137
|
+
|
|
138
|
+
if (viewportOffset) {
|
|
139
|
+
viewport[dirs[i][2]] += viewportOffset;
|
|
140
|
+
viewport[dirs[i][3]] -= viewportOffset;
|
|
141
|
+
}
|
|
142
|
+
|
|
143
|
+
if (boundary) {
|
|
144
|
+
viewport = getIntersectionArea(viewport, offset(boundary));
|
|
145
|
+
}
|
|
146
|
+
|
|
147
|
+
return viewport;
|
|
148
|
+
}
|
|
149
|
+
|
|
150
|
+
function getScrollArea(element, viewportOffset, i) {
|
|
151
|
+
const [prop, , start, end] = dirs[i];
|
|
152
|
+
const [scrollElement] = scrollParents(element);
|
|
153
|
+
const viewport = offsetViewport(scrollElement);
|
|
154
|
+
viewport[start] -= scrollElement[`scroll${ucfirst(start)}`] - viewportOffset;
|
|
155
|
+
viewport[end] = viewport[start] + scrollElement[`scroll${ucfirst(prop)}`] - viewportOffset;
|
|
156
|
+
return viewport;
|
|
157
|
+
}
|
|
158
|
+
|
|
182
159
|
function getIntersectionArea(...rects) {
|
|
183
160
|
let area = {};
|
|
184
161
|
for (const rect of rects) {
|
|
@@ -190,21 +167,44 @@ function getIntersectionArea(...rects) {
|
|
|
190
167
|
return area;
|
|
191
168
|
}
|
|
192
169
|
|
|
193
|
-
function
|
|
194
|
-
const
|
|
195
|
-
|
|
196
|
-
|
|
197
|
-
viewport[end] = viewport[start] + scrollElement[`scroll${ucfirst(prop)}`];
|
|
170
|
+
function isWithin(positionA, positionB, i) {
|
|
171
|
+
const [, , start, end] = dirs[i];
|
|
172
|
+
return positionA[start] >= positionB[start] && positionA[end] <= positionB[end];
|
|
173
|
+
}
|
|
198
174
|
|
|
199
|
-
|
|
175
|
+
function flip(element, target, { offset, attach }, i) {
|
|
176
|
+
return attachTo(element, target, {
|
|
177
|
+
attach: {
|
|
178
|
+
element: flipAttach(attach.element, i),
|
|
179
|
+
target: flipAttach(attach.target, i),
|
|
180
|
+
},
|
|
181
|
+
offset: flipOffset(offset, i),
|
|
182
|
+
});
|
|
200
183
|
}
|
|
201
184
|
|
|
202
|
-
function
|
|
203
|
-
|
|
204
|
-
|
|
185
|
+
function flipAxis(element, target, options) {
|
|
186
|
+
return getPosition(element, target, {
|
|
187
|
+
...options,
|
|
188
|
+
attach: {
|
|
189
|
+
element: options.attach.element.map(flipAttachAxis).reverse(),
|
|
190
|
+
target: options.attach.target.map(flipAttachAxis).reverse(),
|
|
191
|
+
},
|
|
192
|
+
offset: options.offset.reverse(),
|
|
193
|
+
placement: options.placement.reverse(),
|
|
194
|
+
recursion: true,
|
|
195
|
+
});
|
|
196
|
+
}
|
|
197
|
+
|
|
198
|
+
function flipAttach(attach, i) {
|
|
199
|
+
const newAttach = [...attach];
|
|
200
|
+
const index = dirs[i].indexOf(attach[i]);
|
|
201
|
+
if (~index) {
|
|
202
|
+
newAttach[i] = dirs[i][1 - (index % 2) + 2];
|
|
203
|
+
}
|
|
204
|
+
return newAttach;
|
|
205
205
|
}
|
|
206
206
|
|
|
207
|
-
function
|
|
207
|
+
function flipAttachAxis(prop) {
|
|
208
208
|
for (let i = 0; i < dirs.length; i++) {
|
|
209
209
|
const index = dirs[i].indexOf(prop);
|
|
210
210
|
if (~index) {
|
|
@@ -212,3 +212,9 @@ function flipDir(prop) {
|
|
|
212
212
|
}
|
|
213
213
|
}
|
|
214
214
|
}
|
|
215
|
+
|
|
216
|
+
function flipOffset(offset, i) {
|
|
217
|
+
offset = [...offset];
|
|
218
|
+
offset[i] *= -1;
|
|
219
|
+
return offset;
|
|
220
|
+
}
|
package/src/js/util/viewport.js
CHANGED
|
@@ -150,7 +150,7 @@ export function offsetViewport(scrollElement) {
|
|
|
150
150
|
// iOS 12 returns <body> as scrollingElement
|
|
151
151
|
viewportElement = documentElement;
|
|
152
152
|
} else {
|
|
153
|
-
rect[start] += toFloat(css(viewportElement, `border
|
|
153
|
+
rect[start] += toFloat(css(viewportElement, `border-${start}-width`));
|
|
154
154
|
}
|
|
155
155
|
rect[prop] = rect[dir] = viewportElement[`client${ucfirst(prop)}`];
|
|
156
156
|
rect[end] = rect[prop] + rect[start];
|
|
@@ -3,8 +3,7 @@
|
|
|
3
3
|
//
|
|
4
4
|
// Component: `uk-drop`
|
|
5
5
|
//
|
|
6
|
-
// Modifiers: `uk-drop-
|
|
7
|
-
// `uk-drop-stack`
|
|
6
|
+
// Modifiers: `uk-drop-stack`
|
|
8
7
|
// `uk-drop-grid`
|
|
9
8
|
//
|
|
10
9
|
// States: `uk-open`
|
|
@@ -50,22 +49,6 @@
|
|
|
50
49
|
.uk-drop.uk-open { display: block; }
|
|
51
50
|
|
|
52
51
|
|
|
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
|
-
|
|
69
52
|
/* Grid modifiers
|
|
70
53
|
========================================================================== */
|
|
71
54
|
|
|
@@ -0,0 +1,126 @@
|
|
|
1
|
+
// Name: Dropbar
|
|
2
|
+
// Description: Component to create dropbar menus
|
|
3
|
+
//
|
|
4
|
+
// Component: `uk-dropbar`
|
|
5
|
+
//
|
|
6
|
+
// ========================================================================
|
|
7
|
+
|
|
8
|
+
|
|
9
|
+
// Variables
|
|
10
|
+
// ========================================================================
|
|
11
|
+
|
|
12
|
+
@dropbar-margin: 0;
|
|
13
|
+
@dropbar-z-index: @global-z-index + 20;
|
|
14
|
+
@dropbar-padding-top: 15px;
|
|
15
|
+
@dropbar-padding-bottom: @dropbar-padding-top;
|
|
16
|
+
@dropbar-padding-horizontal: 15px;
|
|
17
|
+
@dropbar-padding-horizontal-s: @global-gutter;
|
|
18
|
+
@dropbar-padding-horizontal-m: @global-medium-gutter;
|
|
19
|
+
@dropbar-background: @global-muted-background;
|
|
20
|
+
@dropbar-color: @global-color;
|
|
21
|
+
@dropbar-color-mode: none;
|
|
22
|
+
|
|
23
|
+
@dropbar-large-padding-top: 40px;
|
|
24
|
+
@dropbar-large-padding-bottom: @dropbar-large-padding-top;
|
|
25
|
+
|
|
26
|
+
|
|
27
|
+
/* ========================================================================
|
|
28
|
+
Component: Dropbar
|
|
29
|
+
========================================================================== */
|
|
30
|
+
|
|
31
|
+
/*
|
|
32
|
+
* 1. Hide by default
|
|
33
|
+
* 2. Set position
|
|
34
|
+
* 3. Style
|
|
35
|
+
*/
|
|
36
|
+
|
|
37
|
+
.uk-dropbar {
|
|
38
|
+
--uk-position-offset: @dropbar-margin;
|
|
39
|
+
--uk-position-shift-offset: 0;
|
|
40
|
+
--uk-position-viewport-offset: 0;
|
|
41
|
+
/* 1 */
|
|
42
|
+
display: none;
|
|
43
|
+
/* 2 */
|
|
44
|
+
position: absolute;
|
|
45
|
+
z-index: @dropbar-z-index;
|
|
46
|
+
/* 3 */
|
|
47
|
+
box-sizing: border-box;
|
|
48
|
+
padding: @dropbar-padding-top @dropbar-padding-horizontal @dropbar-padding-bottom @dropbar-padding-horizontal;
|
|
49
|
+
background: @dropbar-background;
|
|
50
|
+
color: @dropbar-color;
|
|
51
|
+
.hook-dropbar();
|
|
52
|
+
}
|
|
53
|
+
|
|
54
|
+
/* Show */
|
|
55
|
+
.uk-dropbar.uk-open { display: block; }
|
|
56
|
+
|
|
57
|
+
/*
|
|
58
|
+
* Remove margin from the last-child
|
|
59
|
+
*/
|
|
60
|
+
|
|
61
|
+
.uk-dropbar > :last-child { margin-bottom: 0; }
|
|
62
|
+
|
|
63
|
+
/* Phone landscape and bigger */
|
|
64
|
+
@media (min-width: @breakpoint-small) {
|
|
65
|
+
|
|
66
|
+
.uk-dropbar {
|
|
67
|
+
padding-left: @dropbar-padding-horizontal-s;
|
|
68
|
+
padding-right: @dropbar-padding-horizontal-s;
|
|
69
|
+
}
|
|
70
|
+
|
|
71
|
+
}
|
|
72
|
+
|
|
73
|
+
/* Tablet landscape and bigger */
|
|
74
|
+
@media (min-width: @breakpoint-medium) {
|
|
75
|
+
|
|
76
|
+
.uk-dropbar {
|
|
77
|
+
padding-left: @dropbar-padding-horizontal-m;
|
|
78
|
+
padding-right: @dropbar-padding-horizontal-m;
|
|
79
|
+
}
|
|
80
|
+
|
|
81
|
+
}
|
|
82
|
+
|
|
83
|
+
// Color Mode
|
|
84
|
+
.uk-dropbar:extend(.uk-light all) when (@dropbar-color-mode = light) {}
|
|
85
|
+
.uk-dropbar:extend(.uk-dark all) when (@dropbar-color-mode = dark) {}
|
|
86
|
+
|
|
87
|
+
/* Size modifier
|
|
88
|
+
========================================================================== */
|
|
89
|
+
|
|
90
|
+
.uk-dropbar-large {
|
|
91
|
+
padding-top: @dropbar-large-padding-top;
|
|
92
|
+
padding-bottom: @dropbar-large-padding-bottom;
|
|
93
|
+
}
|
|
94
|
+
|
|
95
|
+
|
|
96
|
+
/* Direction modifier
|
|
97
|
+
========================================================================== */
|
|
98
|
+
|
|
99
|
+
.uk-dropbar-top {
|
|
100
|
+
.hook-dropbar-top();
|
|
101
|
+
}
|
|
102
|
+
|
|
103
|
+
.uk-dropbar-bottom {
|
|
104
|
+
.hook-dropbar-bottom();
|
|
105
|
+
}
|
|
106
|
+
|
|
107
|
+
.uk-dropbar-left {
|
|
108
|
+
.hook-dropbar-left();
|
|
109
|
+
}
|
|
110
|
+
|
|
111
|
+
.uk-dropbar-right {
|
|
112
|
+
.hook-dropbar-right();
|
|
113
|
+
}
|
|
114
|
+
|
|
115
|
+
|
|
116
|
+
// Hooks
|
|
117
|
+
// ========================================================================
|
|
118
|
+
|
|
119
|
+
.hook-dropbar-misc();
|
|
120
|
+
|
|
121
|
+
.hook-dropbar() {}
|
|
122
|
+
.hook-dropbar-top() {}
|
|
123
|
+
.hook-dropbar-bottom() {}
|
|
124
|
+
.hook-dropbar-left() {}
|
|
125
|
+
.hook-dropbar-right() {}
|
|
126
|
+
.hook-dropbar-misc() {}
|
|
@@ -5,7 +5,7 @@
|
|
|
5
5
|
//
|
|
6
6
|
// Adopted: `uk-dropdown-nav`
|
|
7
7
|
//
|
|
8
|
-
// Modifiers: `uk-dropdown-
|
|
8
|
+
// Modifiers: `uk-dropdown-large`
|
|
9
9
|
// `uk-dropdown-stack`
|
|
10
10
|
// `uk-dropdown-grid`
|
|
11
11
|
//
|
|
@@ -24,6 +24,7 @@
|
|
|
24
24
|
@dropdown-padding: 15px;
|
|
25
25
|
@dropdown-background: @global-muted-background;
|
|
26
26
|
@dropdown-color: @global-color;
|
|
27
|
+
@dropdown-color-mode: none;
|
|
27
28
|
|
|
28
29
|
@dropdown-large-padding: 40px;
|
|
29
30
|
|
|
@@ -59,7 +60,6 @@
|
|
|
59
60
|
/* 3 */
|
|
60
61
|
box-sizing: border-box;
|
|
61
62
|
min-width: @dropdown-min-width;
|
|
62
|
-
max-width: 100vw;
|
|
63
63
|
/* 4 */
|
|
64
64
|
padding: @dropdown-padding;
|
|
65
65
|
background: @dropdown-background;
|
|
@@ -76,6 +76,10 @@
|
|
|
76
76
|
|
|
77
77
|
.uk-dropdown > :last-child { margin-bottom: 0; }
|
|
78
78
|
|
|
79
|
+
// Color Mode
|
|
80
|
+
.uk-dropdown:extend(.uk-light all) when (@dropdown-color-mode = light) {}
|
|
81
|
+
.uk-dropdown:extend(.uk-dark all) when (@dropdown-color-mode = dark) {}
|
|
82
|
+
|
|
79
83
|
|
|
80
84
|
/* Size modifier
|
|
81
85
|
========================================================================== */
|
|
@@ -83,23 +87,6 @@
|
|
|
83
87
|
.uk-dropdown-large { padding: @dropdown-large-padding; }
|
|
84
88
|
|
|
85
89
|
|
|
86
|
-
/* Stretch modifier
|
|
87
|
-
========================================================================== */
|
|
88
|
-
|
|
89
|
-
/*
|
|
90
|
-
* 1. Allow scrolling
|
|
91
|
-
*/
|
|
92
|
-
|
|
93
|
-
.uk-dropdown-stretch {
|
|
94
|
-
--uk-position-offset: 0;
|
|
95
|
-
--uk-position-viewport-offset: 0;
|
|
96
|
-
/* 1 */
|
|
97
|
-
overflow-y: auto;
|
|
98
|
-
-webkit-overflow-scrolling: touch;
|
|
99
|
-
.hook-dropdown-stretch();
|
|
100
|
-
}
|
|
101
|
-
|
|
102
|
-
|
|
103
90
|
/* Nav
|
|
104
91
|
* Adopts `uk-nav`
|
|
105
92
|
========================================================================== */
|
|
@@ -174,7 +161,6 @@
|
|
|
174
161
|
.hook-dropdown-misc();
|
|
175
162
|
|
|
176
163
|
.hook-dropdown() {}
|
|
177
|
-
.hook-dropdown-stretch() {}
|
|
178
164
|
.hook-dropdown-nav() {}
|
|
179
165
|
.hook-dropdown-nav-item() {}
|
|
180
166
|
.hook-dropdown-nav-item-hover() {}
|