uikit 3.13.6-dev.f130508b6 → 3.13.7-dev.120e5ee9c
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 +15 -4
- package/build/util.js +1 -1
- package/dist/css/uikit-core-rtl.css +7 -12
- package/dist/css/uikit-core-rtl.min.css +1 -1
- package/dist/css/uikit-core.css +7 -12
- package/dist/css/uikit-core.min.css +1 -1
- package/dist/css/uikit-rtl.css +7 -12
- package/dist/css/uikit-rtl.min.css +1 -1
- package/dist/css/uikit.css +7 -12
- 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 +1 -1
- package/dist/js/components/lightbox-panel.min.js +1 -1
- package/dist/js/components/lightbox.js +1 -1
- package/dist/js/components/lightbox.min.js +1 -1
- package/dist/js/components/notification.js +1 -1
- 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 +2 -2
- 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 +2 -2
- 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 +19 -53
- 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 +146 -228
- package/dist/js/uikit-core.min.js +1 -1
- package/dist/js/uikit-icons.js +1 -1
- package/dist/js/uikit-icons.min.js +1 -1
- package/dist/js/uikit.js +146 -228
- package/dist/js/uikit.min.js +1 -1
- package/package.json +1 -1
- package/src/js/components/slider-parallax.js +1 -1
- package/src/js/core/drop.js +1 -1
- package/src/js/core/height-match.js +3 -0
- package/src/js/core/height-viewport.js +4 -2
- package/src/js/core/img.js +0 -57
- package/src/js/mixin/position.js +16 -49
- package/src/js/util/position.js +129 -125
- package/src/less/components/drop.less +1 -1
- package/src/less/components/dropdown.less +1 -1
- package/src/less/components/nav.less +1 -5
- package/src/less/components/navbar.less +2 -2
- package/src/less/components/tooltip.less +1 -1
- package/src/scss/components/drop.scss +1 -1
- package/src/scss/components/dropdown.scss +1 -1
- package/src/scss/components/nav.scss +1 -5
- package/src/scss/components/navbar.scss +2 -2
- package/src/scss/components/tooltip.scss +1 -1
- package/tests/position.html +39 -38
package/package.json
CHANGED
|
@@ -2,7 +2,7 @@
|
|
|
2
2
|
"name": "uikit",
|
|
3
3
|
"title": "UIkit",
|
|
4
4
|
"description": "UIkit is a lightweight and modular front-end framework for developing fast and powerful web interfaces.",
|
|
5
|
-
"version": "3.13.
|
|
5
|
+
"version": "3.13.7-dev.120e5ee9c",
|
|
6
6
|
"main": "dist/js/uikit.js",
|
|
7
7
|
"style": "dist/css/uikit.css",
|
|
8
8
|
"sideEffects": [
|
package/src/js/core/drop.js
CHANGED
|
@@ -360,7 +360,7 @@ export default {
|
|
|
360
360
|
const targetOffset = offset(this.target);
|
|
361
361
|
const alignTo = this.boundaryAlign ? boundaryOffset : targetOffset;
|
|
362
362
|
|
|
363
|
-
if (this.
|
|
363
|
+
if (this.pos[1] === 'justify') {
|
|
364
364
|
const prop = this.getAxis() === 'y' ? 'width' : 'height';
|
|
365
365
|
css(this.$el, prop, alignTo[prop]);
|
|
366
366
|
} else if (
|
|
@@ -46,11 +46,13 @@ export default {
|
|
|
46
46
|
const box = boxModelAdjust(this.$el, 'height', 'content-box');
|
|
47
47
|
|
|
48
48
|
if (this.expand) {
|
|
49
|
-
minHeight =
|
|
49
|
+
minHeight = Math.max(
|
|
50
50
|
height(window) -
|
|
51
51
|
(dimensions(document.documentElement).height -
|
|
52
52
|
dimensions(this.$el).height) -
|
|
53
|
-
box
|
|
53
|
+
box,
|
|
54
|
+
0
|
|
55
|
+
);
|
|
54
56
|
} else {
|
|
55
57
|
// on mobile devices (iOS and Android) window.innerHeight !== 100vh
|
|
56
58
|
minHeight = 'calc(100vh';
|
package/src/js/core/img.js
CHANGED
|
@@ -19,7 +19,6 @@ import {
|
|
|
19
19
|
queryAll,
|
|
20
20
|
removeAttr,
|
|
21
21
|
startsWith,
|
|
22
|
-
toFloat,
|
|
23
22
|
toPx,
|
|
24
23
|
trigger,
|
|
25
24
|
} from 'uikit-util';
|
|
@@ -89,25 +88,6 @@ export default {
|
|
|
89
88
|
}
|
|
90
89
|
},
|
|
91
90
|
|
|
92
|
-
update: {
|
|
93
|
-
write(store) {
|
|
94
|
-
if (!this.observer || isImg(this.$el)) {
|
|
95
|
-
return false;
|
|
96
|
-
}
|
|
97
|
-
|
|
98
|
-
const srcset = data(this.$el, 'data-srcset');
|
|
99
|
-
if (srcset && window.devicePixelRatio !== 1) {
|
|
100
|
-
const bgSize = css(this.$el, 'backgroundSize');
|
|
101
|
-
if (bgSize.match(/^(auto\s?)+$/) || toFloat(bgSize) === store.bgSize) {
|
|
102
|
-
store.bgSize = getSourceSize(srcset, data(this.$el, 'sizes'));
|
|
103
|
-
css(this.$el, 'backgroundSize', `${store.bgSize}px`);
|
|
104
|
-
}
|
|
105
|
-
}
|
|
106
|
-
},
|
|
107
|
-
|
|
108
|
-
events: ['resize'],
|
|
109
|
-
},
|
|
110
|
-
|
|
111
91
|
methods: {
|
|
112
92
|
load() {
|
|
113
93
|
if (this._data.image) {
|
|
@@ -197,43 +177,6 @@ function parseSources(sources) {
|
|
|
197
177
|
return sources.filter((source) => !isEmpty(source));
|
|
198
178
|
}
|
|
199
179
|
|
|
200
|
-
const sizesRe = /\s*(.*?)\s*(\w+|calc\(.*?\))\s*(?:,|$)/g;
|
|
201
|
-
function sizesToPixel(sizes) {
|
|
202
|
-
let matches;
|
|
203
|
-
|
|
204
|
-
sizesRe.lastIndex = 0;
|
|
205
|
-
|
|
206
|
-
while ((matches = sizesRe.exec(sizes))) {
|
|
207
|
-
if (!matches[1] || window.matchMedia(matches[1]).matches) {
|
|
208
|
-
matches = evaluateSize(matches[2]);
|
|
209
|
-
break;
|
|
210
|
-
}
|
|
211
|
-
}
|
|
212
|
-
|
|
213
|
-
return matches || '100vw';
|
|
214
|
-
}
|
|
215
|
-
|
|
216
|
-
const sizeRe = /\d+(?:\w+|%)/g;
|
|
217
|
-
const additionRe = /[+-]?(\d+)/g;
|
|
218
|
-
function evaluateSize(size) {
|
|
219
|
-
return startsWith(size, 'calc')
|
|
220
|
-
? size
|
|
221
|
-
.slice(5, -1)
|
|
222
|
-
.replace(sizeRe, (size) => toPx(size))
|
|
223
|
-
.replace(/ /g, '')
|
|
224
|
-
.match(additionRe)
|
|
225
|
-
.reduce((a, b) => a + +b, 0)
|
|
226
|
-
: size;
|
|
227
|
-
}
|
|
228
|
-
|
|
229
|
-
const srcSetRe = /\s+\d+w\s*(?:,|$)/g;
|
|
230
|
-
function getSourceSize(srcset, sizes) {
|
|
231
|
-
const srcSize = toPx(sizesToPixel(sizes));
|
|
232
|
-
const descriptors = (srcset.match(srcSetRe) || []).map(toFloat).sort((a, b) => a - b);
|
|
233
|
-
|
|
234
|
-
return descriptors.filter((size) => size >= srcSize)[0] || descriptors.pop() || '';
|
|
235
|
-
}
|
|
236
|
-
|
|
237
180
|
function ensureSrcAttribute(el) {
|
|
238
181
|
if (isImg(el) && !hasAttr(el, 'src')) {
|
|
239
182
|
attr(el, 'src', 'data:image/svg+xml;utf8,<svg xmlns="http://www.w3.org/2000/svg"></svg>');
|
package/src/js/mixin/position.js
CHANGED
|
@@ -3,7 +3,6 @@ import {
|
|
|
3
3
|
flipPosition,
|
|
4
4
|
getCssVar,
|
|
5
5
|
offset as getOffset,
|
|
6
|
-
includes,
|
|
7
6
|
isNumeric,
|
|
8
7
|
isRtl,
|
|
9
8
|
positionAt,
|
|
@@ -43,59 +42,27 @@ export default {
|
|
|
43
42
|
getOffset(target)[axis === 'x' ? 'right' : 'bottom']
|
|
44
43
|
: 0;
|
|
45
44
|
}
|
|
46
|
-
offset = toPx(offset) + toPx(getCssVar('position-
|
|
45
|
+
offset = toPx(offset) + toPx(getCssVar('position-offset', element));
|
|
47
46
|
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
|
|
54
|
-
|
|
55
|
-
|
|
56
|
-
|
|
57
|
-
|
|
58
|
-
|
|
59
|
-
|
|
47
|
+
const { x, y } = positionAt(
|
|
48
|
+
element,
|
|
49
|
+
target,
|
|
50
|
+
axis === 'x' ? `${flipPosition(dir)} ${align}` : `${align} ${flipPosition(dir)}`,
|
|
51
|
+
axis === 'x' ? `${dir} ${align}` : `${align} ${dir}`,
|
|
52
|
+
axis === 'x'
|
|
53
|
+
? `${dir === 'left' ? -offset : offset}`
|
|
54
|
+
: ` ${dir === 'top' ? -offset : offset}`,
|
|
55
|
+
null,
|
|
56
|
+
this.flip,
|
|
57
|
+
boundary
|
|
58
|
+
).target;
|
|
60
59
|
|
|
61
|
-
|
|
60
|
+
this.dir = axis === 'x' ? x : y;
|
|
61
|
+
this.align = axis === 'x' ? y : x;
|
|
62
62
|
},
|
|
63
63
|
|
|
64
64
|
getAxis() {
|
|
65
|
-
return
|
|
65
|
+
return this.dir === 'top' || this.dir === 'bottom' ? 'y' : 'x';
|
|
66
66
|
},
|
|
67
67
|
},
|
|
68
68
|
};
|
|
69
|
-
|
|
70
|
-
function getAlignment(el, target) {
|
|
71
|
-
const elOffset = getOffset(el);
|
|
72
|
-
const targetOffset = getOffset(target);
|
|
73
|
-
const properties = [
|
|
74
|
-
['left', 'right'],
|
|
75
|
-
['top', 'bottom'],
|
|
76
|
-
];
|
|
77
|
-
|
|
78
|
-
let dir;
|
|
79
|
-
for (const props of properties) {
|
|
80
|
-
if (elOffset[props[0]] >= targetOffset[props[1]]) {
|
|
81
|
-
dir = props[1];
|
|
82
|
-
break;
|
|
83
|
-
}
|
|
84
|
-
if (elOffset[props[1]] <= targetOffset[props[0]]) {
|
|
85
|
-
dir = props[0];
|
|
86
|
-
break;
|
|
87
|
-
}
|
|
88
|
-
}
|
|
89
|
-
|
|
90
|
-
let align;
|
|
91
|
-
const props = includes(properties[0], dir) ? properties[1] : properties[0];
|
|
92
|
-
if (elOffset[props[0]] === targetOffset[props[0]]) {
|
|
93
|
-
align = props[0];
|
|
94
|
-
} else if (elOffset[props[1]] === targetOffset[props[1]]) {
|
|
95
|
-
align = props[1];
|
|
96
|
-
} else {
|
|
97
|
-
align = 'center';
|
|
98
|
-
}
|
|
99
|
-
|
|
100
|
-
return [dir, align];
|
|
101
|
-
}
|
package/src/js/util/position.js
CHANGED
|
@@ -1,152 +1,156 @@
|
|
|
1
1
|
import { offset } from './dimensions';
|
|
2
|
-
import {
|
|
2
|
+
import { each, endsWith, includes, toFloat } from './lang';
|
|
3
3
|
import { getViewport, scrollParents } from './viewport';
|
|
4
4
|
|
|
5
|
-
const dirs =
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
export function positionAt(
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
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 in dirs) {
|
|
42
|
-
const [prop, dir, start, end] = dirs[i];
|
|
43
|
-
position[start] = position[dir] =
|
|
44
|
-
targetOffset[start] +
|
|
45
|
-
moveBy(attach.target[i], end, targetOffset[prop]) -
|
|
46
|
-
moveBy(attach.element[i], end, position[prop]) +
|
|
47
|
-
+offsetBy[i];
|
|
48
|
-
position[end] = position[start] + position[prop];
|
|
5
|
+
const dirs = {
|
|
6
|
+
width: ['x', 'left', 'right'],
|
|
7
|
+
height: ['y', 'top', 'bottom'],
|
|
8
|
+
};
|
|
9
|
+
|
|
10
|
+
export function positionAt(
|
|
11
|
+
element,
|
|
12
|
+
target,
|
|
13
|
+
elAttach,
|
|
14
|
+
targetAttach,
|
|
15
|
+
elOffset,
|
|
16
|
+
targetOffset,
|
|
17
|
+
flip,
|
|
18
|
+
boundary
|
|
19
|
+
) {
|
|
20
|
+
elAttach = getPos(elAttach);
|
|
21
|
+
targetAttach = getPos(targetAttach);
|
|
22
|
+
|
|
23
|
+
const flipped = { element: elAttach, target: targetAttach };
|
|
24
|
+
|
|
25
|
+
if (!element || !target) {
|
|
26
|
+
return flipped;
|
|
49
27
|
}
|
|
50
|
-
return position;
|
|
51
|
-
}
|
|
52
28
|
|
|
53
|
-
|
|
54
|
-
const position = attachTo(element, target, options);
|
|
29
|
+
const dim = offset(element);
|
|
55
30
|
const targetDim = offset(target);
|
|
56
|
-
const
|
|
57
|
-
|
|
58
|
-
let {
|
|
59
|
-
flip,
|
|
60
|
-
attach: { element: elAttach, target: targetAttach },
|
|
61
|
-
offset: elOffset,
|
|
62
|
-
boundary,
|
|
63
|
-
viewport,
|
|
64
|
-
} = options;
|
|
31
|
+
const position = targetDim;
|
|
65
32
|
|
|
66
|
-
|
|
33
|
+
moveTo(position, elAttach, dim, -1);
|
|
34
|
+
moveTo(position, targetAttach, targetDim, 1);
|
|
67
35
|
|
|
68
|
-
|
|
69
|
-
|
|
36
|
+
elOffset = getOffsets(elOffset, dim.width, dim.height);
|
|
37
|
+
targetOffset = getOffsets(targetOffset, targetDim.width, targetDim.height);
|
|
70
38
|
|
|
71
|
-
|
|
72
|
-
|
|
73
|
-
}
|
|
39
|
+
elOffset['x'] += targetOffset['x'];
|
|
40
|
+
elOffset['y'] += targetOffset['y'];
|
|
74
41
|
|
|
75
|
-
|
|
76
|
-
|
|
42
|
+
position.left += elOffset['x'];
|
|
43
|
+
position.top += elOffset['y'];
|
|
77
44
|
|
|
78
|
-
|
|
79
|
-
|
|
80
|
-
const isInEndBoundary = position[end] <= viewport[end];
|
|
45
|
+
if (flip) {
|
|
46
|
+
let boundaries = scrollParents(element).map(getViewport);
|
|
81
47
|
|
|
82
|
-
if (
|
|
83
|
-
|
|
48
|
+
if (boundary && !includes(boundaries, boundary)) {
|
|
49
|
+
boundaries.unshift(boundary);
|
|
84
50
|
}
|
|
85
51
|
|
|
86
|
-
|
|
52
|
+
boundaries = boundaries.map((el) => offset(el));
|
|
87
53
|
|
|
88
|
-
|
|
89
|
-
|
|
90
|
-
|
|
91
|
-
(elAttach[i] === end && isInStartBoundary) ||
|
|
92
|
-
(elAttach[i] === start && isInEndBoundary)
|
|
93
|
-
) {
|
|
94
|
-
continue;
|
|
54
|
+
each(dirs, ([dir, align, alignFlip], prop) => {
|
|
55
|
+
if (!(flip === true || includes(flip, dir))) {
|
|
56
|
+
return;
|
|
95
57
|
}
|
|
96
58
|
|
|
97
|
-
|
|
98
|
-
|
|
99
|
-
|
|
100
|
-
|
|
101
|
-
|
|
102
|
-
|
|
103
|
-
|
|
104
|
-
|
|
105
|
-
|
|
106
|
-
|
|
107
|
-
|
|
108
|
-
|
|
109
|
-
|
|
110
|
-
|
|
111
|
-
|
|
112
|
-
|
|
113
|
-
|
|
114
|
-
|
|
115
|
-
|
|
116
|
-
|
|
117
|
-
|
|
118
|
-
|
|
119
|
-
|
|
120
|
-
|
|
121
|
-
|
|
59
|
+
boundaries.some((boundary) => {
|
|
60
|
+
const elemOffset =
|
|
61
|
+
elAttach[dir] === align
|
|
62
|
+
? -dim[prop]
|
|
63
|
+
: elAttach[dir] === alignFlip
|
|
64
|
+
? dim[prop]
|
|
65
|
+
: 0;
|
|
66
|
+
|
|
67
|
+
const targetOffset =
|
|
68
|
+
targetAttach[dir] === align
|
|
69
|
+
? targetDim[prop]
|
|
70
|
+
: targetAttach[dir] === alignFlip
|
|
71
|
+
? -targetDim[prop]
|
|
72
|
+
: 0;
|
|
73
|
+
|
|
74
|
+
if (
|
|
75
|
+
position[align] < boundary[align] ||
|
|
76
|
+
position[align] + dim[prop] > boundary[alignFlip]
|
|
77
|
+
) {
|
|
78
|
+
const centerOffset = dim[prop] / 2;
|
|
79
|
+
const centerTargetOffset =
|
|
80
|
+
targetAttach[dir] === 'center' ? -targetDim[prop] / 2 : 0;
|
|
81
|
+
|
|
82
|
+
return (
|
|
83
|
+
(elAttach[dir] === 'center' &&
|
|
84
|
+
(apply(centerOffset, centerTargetOffset) ||
|
|
85
|
+
apply(-centerOffset, -centerTargetOffset))) ||
|
|
86
|
+
apply(elemOffset, targetOffset)
|
|
87
|
+
);
|
|
88
|
+
}
|
|
89
|
+
|
|
90
|
+
function apply(elemOffset, targetOffset) {
|
|
91
|
+
const newVal = toFloat(
|
|
92
|
+
(position[align] + elemOffset + targetOffset - elOffset[dir] * 2).toFixed(4)
|
|
93
|
+
);
|
|
94
|
+
|
|
95
|
+
if (newVal >= boundary[align] && newVal + dim[prop] <= boundary[alignFlip]) {
|
|
96
|
+
position[align] = newVal;
|
|
97
|
+
|
|
98
|
+
for (const el of ['element', 'target']) {
|
|
99
|
+
if (elemOffset) {
|
|
100
|
+
flipped[el][dir] =
|
|
101
|
+
flipped[el][dir] === dirs[prop][1]
|
|
102
|
+
? dirs[prop][2]
|
|
103
|
+
: dirs[prop][1];
|
|
104
|
+
}
|
|
105
|
+
}
|
|
106
|
+
|
|
107
|
+
return true;
|
|
108
|
+
}
|
|
109
|
+
}
|
|
110
|
+
});
|
|
111
|
+
});
|
|
122
112
|
}
|
|
123
113
|
|
|
124
|
-
|
|
125
|
-
}
|
|
114
|
+
offset(element, position);
|
|
126
115
|
|
|
127
|
-
|
|
128
|
-
return start === 'center' ? dim / 2 : start === end ? dim : 0;
|
|
116
|
+
return flipped;
|
|
129
117
|
}
|
|
130
118
|
|
|
131
|
-
function
|
|
132
|
-
|
|
133
|
-
|
|
134
|
-
|
|
135
|
-
if (
|
|
136
|
-
|
|
137
|
-
continue;
|
|
138
|
-
}
|
|
139
|
-
for (const prop of ['left', 'top']) {
|
|
140
|
-
intersection[prop] = Math.max(rect[prop], intersection[prop]);
|
|
141
|
-
}
|
|
142
|
-
for (const prop of ['right', 'bottom']) {
|
|
143
|
-
intersection[prop] = Math.min(rect[prop], intersection[prop]);
|
|
119
|
+
function moveTo(position, attach, dim, factor) {
|
|
120
|
+
each(dirs, ([dir, align, alignFlip], prop) => {
|
|
121
|
+
if (attach[dir] === alignFlip) {
|
|
122
|
+
position[align] += dim[prop] * factor;
|
|
123
|
+
} else if (attach[dir] === 'center') {
|
|
124
|
+
position[align] += (dim[prop] * factor) / 2;
|
|
144
125
|
}
|
|
126
|
+
});
|
|
127
|
+
}
|
|
128
|
+
|
|
129
|
+
function getPos(pos) {
|
|
130
|
+
const x = /left|center|right/;
|
|
131
|
+
const y = /top|center|bottom/;
|
|
132
|
+
|
|
133
|
+
pos = (pos || '').split(' ');
|
|
134
|
+
|
|
135
|
+
if (pos.length === 1) {
|
|
136
|
+
pos = x.test(pos[0])
|
|
137
|
+
? pos.concat('center')
|
|
138
|
+
: y.test(pos[0])
|
|
139
|
+
? ['center'].concat(pos)
|
|
140
|
+
: ['center', 'center'];
|
|
145
141
|
}
|
|
146
|
-
|
|
142
|
+
|
|
143
|
+
return {
|
|
144
|
+
x: x.test(pos[0]) ? pos[0] : 'center',
|
|
145
|
+
y: y.test(pos[1]) ? pos[1] : 'center',
|
|
146
|
+
};
|
|
147
147
|
}
|
|
148
148
|
|
|
149
|
-
function
|
|
150
|
-
const [,
|
|
151
|
-
|
|
149
|
+
function getOffsets(offsets, width, height) {
|
|
150
|
+
const [x, y] = (offsets || '').split(' ');
|
|
151
|
+
|
|
152
|
+
return {
|
|
153
|
+
x: x ? toFloat(x) * (endsWith(x, '%') ? width / 100 : 1) : 0,
|
|
154
|
+
y: y ? toFloat(y) * (endsWith(y, '%') ? height / 100 : 1) : 0,
|
|
155
|
+
};
|
|
152
156
|
}
|
|
@@ -94,7 +94,6 @@
|
|
|
94
94
|
* 1. Center content vertically, e.g. an icon
|
|
95
95
|
* 2. Imitate white space gap when using flexbox
|
|
96
96
|
* 3. Reset link
|
|
97
|
-
* 4. Space is allocated solely based on content dimensions: 0 0 auto
|
|
98
97
|
*/
|
|
99
98
|
|
|
100
99
|
.uk-nav li > a {
|
|
@@ -107,9 +106,6 @@
|
|
|
107
106
|
text-decoration: none;
|
|
108
107
|
}
|
|
109
108
|
|
|
110
|
-
/* 4 */
|
|
111
|
-
.uk-nav li > a > * { flex: none; }
|
|
112
|
-
|
|
113
109
|
/*
|
|
114
110
|
* Items
|
|
115
111
|
* Must target `a` elements to exclude other elements (e.g. lists)
|
|
@@ -177,7 +173,7 @@ ul.uk-nav-sub {
|
|
|
177
173
|
/* Divider
|
|
178
174
|
========================================================================== */
|
|
179
175
|
|
|
180
|
-
.uk-nav
|
|
176
|
+
.uk-nav .uk-nav-divider {
|
|
181
177
|
margin: @nav-divider-margin-vertical @nav-divider-margin-horizontal;
|
|
182
178
|
.hook-nav-divider();
|
|
183
179
|
}
|
|
@@ -349,7 +349,7 @@
|
|
|
349
349
|
/* 2 */
|
|
350
350
|
position: absolute;
|
|
351
351
|
z-index: @navbar-dropdown-z-index;
|
|
352
|
-
--uk-position-
|
|
352
|
+
--uk-position-offset: @navbar-dropdown-margin;
|
|
353
353
|
/* 3 */
|
|
354
354
|
box-sizing: border-box;
|
|
355
355
|
width: @navbar-dropdown-width;
|
|
@@ -397,7 +397,7 @@
|
|
|
397
397
|
|
|
398
398
|
.uk-navbar-dropdown-dropbar {
|
|
399
399
|
/* 1 */
|
|
400
|
-
--uk-position-
|
|
400
|
+
--uk-position-offset: @navbar-dropdown-dropbar-margin-top;
|
|
401
401
|
/* 2 */
|
|
402
402
|
margin-bottom: @navbar-dropdown-dropbar-margin-bottom;
|
|
403
403
|
padding: @navbar-dropdown-dropbar-padding;
|
|
@@ -53,7 +53,7 @@ $dropdown-nav-sublist-item-hover-color: $global-color !default;
|
|
|
53
53
|
/* 2 */
|
|
54
54
|
position: absolute;
|
|
55
55
|
z-index: $dropdown-z-index;
|
|
56
|
-
--uk-position-
|
|
56
|
+
--uk-position-offset: #{$dropdown-margin};
|
|
57
57
|
/* 3 */
|
|
58
58
|
box-sizing: border-box;
|
|
59
59
|
min-width: $dropdown-min-width;
|
|
@@ -94,7 +94,6 @@ $internal-nav-parent-open-image: "data:image/svg+xml;charset=UTF-8,%3Csvg%20widt
|
|
|
94
94
|
* 1. Center content vertically, e.g. an icon
|
|
95
95
|
* 2. Imitate white space gap when using flexbox
|
|
96
96
|
* 3. Reset link
|
|
97
|
-
* 4. Space is allocated solely based on content dimensions: 0 0 auto
|
|
98
97
|
*/
|
|
99
98
|
|
|
100
99
|
.uk-nav li > a {
|
|
@@ -107,9 +106,6 @@ $internal-nav-parent-open-image: "data:image/svg+xml;charset=UTF-8,%3Csvg%20widt
|
|
|
107
106
|
text-decoration: none;
|
|
108
107
|
}
|
|
109
108
|
|
|
110
|
-
/* 4 */
|
|
111
|
-
.uk-nav li > a > * { flex: none; }
|
|
112
|
-
|
|
113
109
|
/*
|
|
114
110
|
* Items
|
|
115
111
|
* Must target `a` elements to exclude other elements (e.g. lists)
|
|
@@ -177,7 +173,7 @@ ul.uk-nav-sub {
|
|
|
177
173
|
/* Divider
|
|
178
174
|
========================================================================== */
|
|
179
175
|
|
|
180
|
-
.uk-nav
|
|
176
|
+
.uk-nav .uk-nav-divider {
|
|
181
177
|
margin: $nav-divider-margin-vertical $nav-divider-margin-horizontal;
|
|
182
178
|
@if(mixin-exists(hook-nav-divider)) {@include hook-nav-divider();}
|
|
183
179
|
}
|
|
@@ -349,7 +349,7 @@ $navbar-dropbar-z-index: $global-z-index - 20 !default;
|
|
|
349
349
|
/* 2 */
|
|
350
350
|
position: absolute;
|
|
351
351
|
z-index: $navbar-dropdown-z-index;
|
|
352
|
-
--uk-position-
|
|
352
|
+
--uk-position-offset: #{$navbar-dropdown-margin};
|
|
353
353
|
/* 3 */
|
|
354
354
|
box-sizing: border-box;
|
|
355
355
|
width: $navbar-dropdown-width;
|
|
@@ -397,7 +397,7 @@ $navbar-dropbar-z-index: $global-z-index - 20 !default;
|
|
|
397
397
|
|
|
398
398
|
.uk-navbar-dropdown-dropbar {
|
|
399
399
|
/* 1 */
|
|
400
|
-
--uk-position-
|
|
400
|
+
--uk-position-offset: #{$navbar-dropdown-dropbar-margin-top};
|
|
401
401
|
/* 2 */
|
|
402
402
|
margin-bottom: $navbar-dropdown-dropbar-margin-bottom;
|
|
403
403
|
padding: $navbar-dropdown-dropbar-padding;
|