uikit 3.11.2-dev.78e397546 → 3.11.2-dev.9433cd5fd

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 (53) hide show
  1. package/CHANGELOG.md +17 -2
  2. package/dist/css/uikit-core-rtl.css +1 -1
  3. package/dist/css/uikit-core-rtl.min.css +1 -1
  4. package/dist/css/uikit-core.css +1 -1
  5. package/dist/css/uikit-core.min.css +1 -1
  6. package/dist/css/uikit-rtl.css +1 -1
  7. package/dist/css/uikit-rtl.min.css +1 -1
  8. package/dist/css/uikit.css +1 -1
  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 +1 -1
  15. package/dist/js/components/lightbox-panel.min.js +1 -1
  16. package/dist/js/components/lightbox.js +1 -1
  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 +1 -1
  21. package/dist/js/components/parallax.min.js +1 -1
  22. package/dist/js/components/slider-parallax.js +1 -1
  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 +1 -1
  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 +1 -1
  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 +125 -139
  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 +125 -139
  41. package/dist/js/uikit.min.js +1 -1
  42. package/package.json +1 -1
  43. package/src/js/api/state.js +4 -4
  44. package/src/js/core/drop.js +1 -1
  45. package/src/js/core/img.js +96 -99
  46. package/src/js/core/navbar.js +6 -2
  47. package/src/js/core/sticky.js +15 -9
  48. package/src/js/util/options.js +4 -4
  49. package/tests/image.html +22 -38
  50. package/tests/images/test.avif +0 -0
  51. package/tests/images/test.webp +0 -0
  52. package/tests/sticky-parallax.html +1 -1
  53. package/tests/sticky.html +14 -3
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.11.2-dev.78e397546",
5
+ "version": "3.11.2-dev.9433cd5fd",
6
6
  "main": "dist/js/uikit.js",
7
7
  "style": "dist/css/uikit.css",
8
8
  "sideEffects": [
@@ -211,11 +211,11 @@ export default function (UIkit) {
211
211
  on(
212
212
  el,
213
213
  name,
214
- !delegate
215
- ? null
216
- : isString(delegate)
214
+ delegate
215
+ ? isString(delegate)
217
216
  ? delegate
218
- : delegate.call(component),
217
+ : delegate.call(component)
218
+ : null,
219
219
  isString(handler) ? component[handler] : handler.bind(component),
220
220
  {passive, capture, self}
221
221
  )
@@ -308,7 +308,7 @@ export default {
308
308
  if (active) {
309
309
 
310
310
  if (delay && active.isDelaying) {
311
- this.showTimer = setTimeout(this.show, 10);
311
+ this.showTimer = setTimeout(() => matches(target, ':hover') && this.show(), 10);
312
312
  return;
313
313
  }
314
314
 
@@ -1,4 +1,4 @@
1
- import {createEvent, css, Dimensions, escape, getImage, includes, isUndefined, queryAll, startsWith, toFloat, toPx, trigger} from 'uikit-util';
1
+ import {append, attr, children, createEvent, css, data, escape, fragment, includes, isArray, isEmpty, isUndefined, parent, parseOptions, queryAll, startsWith, toFloat, toPx, trigger} from 'uikit-util';
2
2
 
3
3
  export default {
4
4
 
@@ -6,10 +6,7 @@ export default {
6
6
 
7
7
  props: {
8
8
  dataSrc: String,
9
- dataSrcset: Boolean,
10
- sizes: String,
11
- width: Number,
12
- height: Number,
9
+ dataSources: String,
13
10
  offsetTop: String,
14
11
  offsetLeft: String,
15
12
  target: String
@@ -17,10 +14,7 @@ export default {
17
14
 
18
15
  data: {
19
16
  dataSrc: '',
20
- dataSrcset: false,
21
- sizes: false,
22
- width: false,
23
- height: false,
17
+ dataSources: [],
24
18
  offsetTop: '50vh',
25
19
  offsetLeft: '50vw',
26
20
  target: false
@@ -28,26 +22,6 @@ export default {
28
22
 
29
23
  computed: {
30
24
 
31
- cacheKey({dataSrc}) {
32
- return `${this.$name}.${dataSrc}`;
33
- },
34
-
35
- width({width, dataWidth}) {
36
- return width || dataWidth;
37
- },
38
-
39
- height({height, dataHeight}) {
40
- return height || dataHeight;
41
- },
42
-
43
- sizes({sizes, dataSizes}) {
44
- return sizes || dataSizes;
45
- },
46
-
47
- isImg(_, $el) {
48
- return isImg($el);
49
- },
50
-
51
25
  target: {
52
26
 
53
27
  get({target}) {
@@ -58,14 +32,6 @@ export default {
58
32
  this.observe();
59
33
  }
60
34
 
61
- },
62
-
63
- offsetTop({offsetTop}) {
64
- return toPx(offsetTop, 'height');
65
- },
66
-
67
- offsetLeft({offsetLeft}) {
68
- return toPx(offsetLeft, 'width');
69
35
  }
70
36
 
71
37
  },
@@ -73,21 +39,13 @@ export default {
73
39
  connected() {
74
40
 
75
41
  if (!window.IntersectionObserver) {
76
- setSrcAttrs(this.$el, this.dataSrc, this.dataSrcset, this.sizes);
42
+ setSrcAttrs(this.$el, this.dataSrc);
77
43
  return;
78
44
  }
79
45
 
80
- if (storage[this.cacheKey]) {
81
- setSrcAttrs(this.$el, storage[this.cacheKey], this.dataSrcset, this.sizes);
82
- } else if (this.isImg && this.width && this.height) {
83
- setSrcAttrs(this.$el, getPlaceholderImage(this.width, this.height, this.sizes));
84
- }
85
-
86
- this.observer = new IntersectionObserver(this.load, {
87
- rootMargin: `${this.offsetTop}px ${this.offsetLeft}px`
88
- });
89
-
90
- requestAnimationFrame(this.observe);
46
+ const rootMargin = `${toPx(this.offsetTop, 'height')}px ${toPx(this.offsetLeft, 'width')}px`;
47
+ this.observer = new IntersectionObserver(this.load, {rootMargin});
48
+ this.observe();
91
49
 
92
50
  },
93
51
 
@@ -97,32 +55,17 @@ export default {
97
55
 
98
56
  update: {
99
57
 
100
- read({image}) {
101
-
102
- if (!this.observer) {
58
+ write(store) {
59
+ if (!this.observer || isImg(this.$el)) {
103
60
  return false;
104
61
  }
105
-
106
- if (!image && document.readyState === 'complete') {
107
- this.load(this.observer.takeRecords());
108
- }
109
-
110
- if (this.isImg) {
111
- return false;
112
- }
113
-
114
- image && image.then(img => img && img.currentSrc !== '' && setSrcAttrs(this.$el, currentSrc(img)));
115
-
116
- },
117
-
118
- write(data) {
119
-
120
- if (this.dataSrcset && window.devicePixelRatio !== 1) {
62
+ const srcset = data(this.$el, 'data-srcset');
63
+ if (srcset && window.devicePixelRatio !== 1) {
121
64
 
122
65
  const bgSize = css(this.$el, 'backgroundSize');
123
- if (bgSize.match(/^(auto\s?)+$/) || toFloat(bgSize) === data.bgSize) {
124
- data.bgSize = getSourceSize(this.dataSrcset, this.sizes);
125
- css(this.$el, 'backgroundSize', `${data.bgSize}px`);
66
+ if (bgSize.match(/^(auto\s?)+$/) || toFloat(bgSize) === store.bgSize) {
67
+ store.bgSize = getSourceSize(srcset, data(this.$el, 'sizes'));
68
+ css(this.$el, 'backgroundSize', `${store.bgSize}px`);
126
69
  }
127
70
 
128
71
  }
@@ -142,13 +85,20 @@ export default {
142
85
  return;
143
86
  }
144
87
 
145
- this._data.image = getImage(this.dataSrc, this.dataSrcset, this.sizes).then(img => {
88
+ if (this._data.image) {
89
+ return this._data.image;
90
+ }
146
91
 
147
- setSrcAttrs(this.$el, currentSrc(img), img.srcset, img.sizes);
148
- storage[this.cacheKey] = currentSrc(img);
149
- return img;
92
+ const image = isImg(this.$el)
93
+ ? this.$el
94
+ : getImageFromElement(
95
+ this.$el,
96
+ this.dataSrc,
97
+ this.dataSources
98
+ );
150
99
 
151
- }, e => trigger(this.$el, new e.constructor(e.type, e)));
100
+ this._data.image = image;
101
+ setSrcAttrs(this.$el, image.currentSrc);
152
102
 
153
103
  this.observer.disconnect();
154
104
  },
@@ -163,13 +113,15 @@ export default {
163
113
 
164
114
  };
165
115
 
166
- function setSrcAttrs(el, src, srcset, sizes) {
116
+ function setSrcAttrs(el, src) {
167
117
 
168
118
  if (isImg(el)) {
169
- const set = (prop, val) => val && val !== el[prop] && (el[prop] = val);
170
- set('sizes', sizes);
171
- set('srcset', srcset);
172
- set('src', src);
119
+
120
+ const parentNode = parent(el);
121
+ const elements = isPicture(parentNode) ? children(parentNode) : [el];
122
+ elements.forEach(el => setSourceProps(el, el));
123
+ src && attr(el, 'src', src);
124
+
173
125
  } else if (src) {
174
126
 
175
127
  const change = !includes(el.style.backgroundImage, src);
@@ -182,13 +134,66 @@ function setSrcAttrs(el, src, srcset, sizes) {
182
134
 
183
135
  }
184
136
 
185
- function getPlaceholderImage(width, height, sizes) {
137
+ const srcProps = ['data-src', 'data-srcset', 'sizes'];
138
+ function setSourceProps(sourceEl, targetEl) {
139
+ srcProps.forEach(prop => {
140
+ const value = data(sourceEl, prop);
141
+ if (value) {
142
+ attr(targetEl, prop.replace(/^(data-)+/, ''), value);
143
+ }
144
+ });
145
+ }
146
+
147
+ function getImageFromElement(el, src, sources) {
186
148
 
187
- if (sizes) {
188
- ({width, height} = Dimensions.ratio({width, height}, 'width', toPx(sizesToPixel(sizes))));
149
+ if (!src) {
150
+ return false;
189
151
  }
190
152
 
191
- return `data:image/svg+xml;utf8,<svg xmlns="http://www.w3.org/2000/svg" width="${width}" height="${height}"></svg>`;
153
+ const img = new Image();
154
+
155
+ wrapInPicture(img, sources);
156
+ setSourceProps(el, img);
157
+ img.onload = () => setSrcAttrs(el, img.currentSrc);
158
+ attr(img, 'src', src);
159
+ return img;
160
+ }
161
+
162
+ function wrapInPicture(img, sources) {
163
+
164
+ sources = parseSources(sources);
165
+
166
+ if (sources.length) {
167
+ const picture = fragment('<picture>');
168
+ sources.forEach(attrs => {
169
+ const source = fragment('<source>');
170
+ attr(source, attrs);
171
+ append(picture, source);
172
+ });
173
+ append(picture, img);
174
+ }
175
+ }
176
+
177
+ function parseSources(sources) {
178
+ if (!sources) {
179
+ return [];
180
+ }
181
+
182
+ if (startsWith(sources, '[')) {
183
+ try {
184
+ sources = JSON.parse(sources);
185
+ } catch (e) {
186
+ sources = [];
187
+ }
188
+ } else {
189
+ sources = parseOptions(sources);
190
+ }
191
+
192
+ if (!isArray(sources)) {
193
+ sources = [sources];
194
+ }
195
+
196
+ return sources.filter(source => !isEmpty(source));
192
197
  }
193
198
 
194
199
  const sizesRe = /\s*(.*?)\s*(\w+|calc\(.*?\))\s*(?:,|$)/g;
@@ -228,22 +233,14 @@ function getSourceSize(srcset, sizes) {
228
233
  return descriptors.filter(size => size >= srcSize)[0] || descriptors.pop() || '';
229
234
  }
230
235
 
231
- function isImg(el) {
232
- return el.tagName === 'IMG';
236
+ function isPicture(el) {
237
+ return isA(el, 'PICTURE');
233
238
  }
234
239
 
235
- function currentSrc(el) {
236
- return el.currentSrc || el.src;
240
+ function isImg(el) {
241
+ return isA(el, 'IMG');
237
242
  }
238
243
 
239
- const key = '__test__';
240
- let storage;
241
-
242
- // workaround for Safari's private browsing mode and accessing sessionStorage in Blink
243
- try {
244
- storage = window.sessionStorage || {};
245
- storage[key] = 1;
246
- delete storage[key];
247
- } catch (e) {
248
- storage = {};
244
+ function isA(el, tagName) {
245
+ return el && el.tagName === tagName;
249
246
  }
@@ -137,7 +137,7 @@ export default {
137
137
 
138
138
  handler({current}) {
139
139
  const active = this.getActive();
140
- if (active && includes(active.mode, 'hover') && active.target && !within(active.target, current) && !active.tracker.movesTo(active.$el)) {
140
+ if (active && includes(active.mode, 'hover') && active.target && !within(active.target, current) && !active.isDelaying) {
141
141
  active.hide(false);
142
142
  }
143
143
  }
@@ -301,7 +301,11 @@ export default {
301
301
 
302
302
  const active = this.getActive();
303
303
 
304
- if (matches(this.dropbar, ':hover') && active && active.$el === $el) {
304
+ if (matches(this.dropbar, ':hover')
305
+ && active
306
+ && active.$el === $el
307
+ && !this.toggles.some(el => active.target !== el && matches(el, ':focus'))
308
+ ) {
305
309
  e.preventDefault();
306
310
  }
307
311
  }
@@ -1,6 +1,6 @@
1
1
  import Class from '../mixin/class';
2
2
  import Media from '../mixin/media';
3
- import {$, addClass, after, Animation, assign, clamp, css, dimensions, fastdom, height as getHeight, getScrollingElement, hasClass, isNumeric, isString, isVisible, noop, offset, offsetPosition, parent, query, remove, removeClass, replaceClass, scrollTop, toggleClass, toPx, trigger, within} from 'uikit-util';
3
+ import {$, addClass, after, Animation, clamp, css, dimensions, fastdom, height as getHeight, getScrollingElement, hasClass, isNumeric, isString, isVisible, noop, offset, offsetPosition, parent, query, remove, removeClass, replaceClass, scrollTop, toggleClass, toPx, trigger, within} from 'uikit-util';
4
4
 
5
5
  export default {
6
6
 
@@ -143,7 +143,7 @@ export default {
143
143
 
144
144
  {
145
145
 
146
- read({height}, types) {
146
+ read({height, margin}, types) {
147
147
 
148
148
  this.inactive = !this.matchMedia || !isVisible(this.$el);
149
149
 
@@ -151,13 +151,19 @@ export default {
151
151
  return false;
152
152
  }
153
153
 
154
- if (this.isActive && types.has('resize')) {
154
+ const hide = this.isActive && types.has('resize');
155
+ if (hide) {
155
156
  this.hide();
157
+ }
158
+
159
+ if (!this.isActive) {
156
160
  height = this.$el.offsetHeight;
157
- this.show();
161
+ margin = css(this.$el, 'margin');
158
162
  }
159
163
 
160
- height = this.isActive ? height : this.$el.offsetHeight;
164
+ if (hide) {
165
+ this.show();
166
+ }
161
167
 
162
168
  const overflow = Math.max(0, height + this.offset - getHeight(window));
163
169
 
@@ -180,17 +186,17 @@ export default {
180
186
  topOffset,
181
187
  offsetParentTop,
182
188
  height,
189
+ margin,
183
190
  width: dimensions(isVisible(this.widthElement) ? this.widthElement : this.$el).width,
184
- top: offsetPosition(this.placeholder)[0],
185
- margins: css(this.$el, ['marginTop', 'marginBottom', 'marginLeft', 'marginRight'])
191
+ top: offsetPosition(this.placeholder)[0]
186
192
  };
187
193
  },
188
194
 
189
- write({height, margins}) {
195
+ write({height, margin}) {
190
196
 
191
197
  const {placeholder} = this;
192
198
 
193
- css(placeholder, assign({height}, margins));
199
+ css(placeholder, {height, margin});
194
200
 
195
201
  if (!within(placeholder, document)) {
196
202
  after(this.$el, placeholder);
@@ -134,9 +134,8 @@ export function parseOptions(options, args = []) {
134
134
 
135
135
  try {
136
136
 
137
- return !options
138
- ? {}
139
- : startsWith(options, '{')
137
+ return options
138
+ ? startsWith(options, '{')
140
139
  ? JSON.parse(options)
141
140
  : args.length && !includes(options, ':')
142
141
  ? ({[args[0]]: options})
@@ -146,7 +145,8 @@ export function parseOptions(options, args = []) {
146
145
  options[key.trim()] = value.trim();
147
146
  }
148
147
  return options;
149
- }, {});
148
+ }, {})
149
+ : {};
150
150
 
151
151
  } catch (e) {
152
152
  return {};
package/tests/image.html CHANGED
@@ -14,8 +14,6 @@
14
14
 
15
15
  <h1>Image</h1>
16
16
 
17
- <p><button class="uk-button uk-button-default" onclick="sessionStorage.clear()">Clear Session Storage</button></p>
18
-
19
17
  <div class="uk-child-width-1-2@m" uk-grid>
20
18
  <div>
21
19
  <img data-src="https://images.unsplash.com/photo-1522201949034-507737bce479?fit=crop&w=900&h=600&q=80" width="900" height="600" alt="" uk-img>
@@ -25,7 +23,11 @@
25
23
  </div>
26
24
  </div>
27
25
 
28
- <div class="uk-height-large uk-background-cover uk-margin-medium uk-flex uk-flex-center uk-flex-middle uk-light" data-src="https://images.unsplash.com/photo-1490822180406-880c226c150b?fit=crop&w=1200&h=450&q=80" uk-img>
26
+ <div class="uk-height-large uk-background-cover uk-margin-medium uk-flex uk-flex-center uk-flex-middle uk-light" data-src="https://images.unsplash.com/photo-1490822180406-880c226c150b?fit=crop&w=1200&h=450&q=80" data-sources="srcset: images/test.avif; type: image/avif" uk-img>
27
+ <h1>Background Image</h1>
28
+ </div>
29
+
30
+ <div class="uk-height-large uk-background-cover uk-margin-medium uk-flex uk-flex-center uk-flex-middle uk-light" data-src="https://images.unsplash.com/photo-1490822180406-880c226c150b?fit=crop&w=1200&h=450&q=80" data-sources="[{&quot;srcset&quot;: &quot;images/test.avif&quot;, &quot;type&quot;: &quot;image/avif&quot;},{&quot;srcset&quot;: &quot;images/test.webp&quot;, &quot;type&quot;: &quot;image/webp&quot;}]" uk-img>
29
31
  <h1>Background Image</h1>
30
32
  </div>
31
33
 
@@ -255,28 +257,28 @@
255
257
 
256
258
  <ul class="uk-slideshow-items">
257
259
  <li>
258
- <img data-src="images/photo.jpg" alt="" uk-cover data-width="1800" data-height="1200" uk-img="target: !.uk-slideshow-items > :last-child, !* +*">
260
+ <img data-src="images/photo.jpg" alt="" uk-cover width="1800" height="1200" uk-img="target: !.uk-slideshow-items > :last-child, !* +*">
259
261
  <div class="uk-position-center uk-position-small uk-text-center">
260
262
  <h2 uk-slideshow-parallax="x: 100,-100">Heading</h2>
261
263
  <p uk-slideshow-parallax="x: 200,-200">Lorem ipsum dolor sit amet.</p>
262
264
  </div>
263
265
  </li>
264
266
  <li>
265
- <img data-src="images/dark.jpg" alt="" uk-cover data-width="1800" data-height="1200" uk-img="target: !* -*, !* +*">
267
+ <img data-src="images/dark.jpg" alt="" uk-cover width="1800" height="1200" uk-img="target: !* -*, !* +*">
266
268
  <div class="uk-position-center uk-position-small uk-text-center">
267
269
  <h2 uk-slideshow-parallax="x: 100,-100">Heading</h2>
268
270
  <p uk-slideshow-parallax="x: 200,-200">Lorem ipsum dolor sit amet.</p>
269
271
  </div>
270
272
  </li>
271
273
  <li>
272
- <img data-src="images/light.jpg" alt="" uk-cover data-width="1800" data-height="1200" uk-img="target: !* -*, !* +*">
274
+ <img data-src="images/light.jpg" alt="" uk-cover width="1800" height="1200" uk-img="target: !* -*, !* +*">
273
275
  <div class="uk-position-center uk-position-small uk-text-center">
274
276
  <h2 uk-slideshow-parallax="y: -50,0,0; opacity: 1,1,0">Heading</h2>
275
277
  <p uk-slideshow-parallax="y: 50,0,0; opacity: 1,1,0">Lorem ipsum dolor sit amet.</p>
276
278
  </div>
277
279
  </li>
278
280
  <li>
279
- <img data-src="images/photo2.jpg" alt="" uk-cover data-width="1800" data-height="1200" uk-img="target: !* -*, !.uk-slideshow-items > :first-child">
281
+ <img data-src="images/photo2.jpg" alt="" uk-cover width="1800" height="1200" uk-img="target: !* -*, !.uk-slideshow-items > :first-child">
280
282
  <div class="uk-position-center uk-position-small uk-text-center">
281
283
  <h2 uk-slideshow-parallax="x: 200,0,0">Heading</h2>
282
284
  <p uk-slideshow-parallax="x: 0,0,-200">Lorem ipsum dolor sit amet.</p>
@@ -296,43 +298,43 @@
296
298
 
297
299
  <ul class="uk-slider-items uk-child-width-1-2@s uk-child-width-1-3@m">
298
300
  <li>
299
- <img data-src="images/slider1.jpg" alt="" data-width="400" data-height="600" uk-img="target: !.uk-slider-items">
301
+ <img data-src="images/slider1.jpg" alt="" width="400" height="600" uk-img="target: !.uk-slider-items">
300
302
  <div class="uk-position-center uk-panel"><h1 class="uk-transition-slide-bottom-small">1</h1></div>
301
303
  </li>
302
304
  <li>
303
- <img data-src="images/slider2.jpg" alt="" data-width="400" data-height="600" uk-img="target: !.uk-slider-items">
305
+ <img data-src="images/slider2.jpg" alt="" width="400" height="600" uk-img="target: !.uk-slider-items">
304
306
  <div class="uk-position-center uk-panel"><h1 class="uk-transition-slide-bottom-small">2</h1></div>
305
307
  </li>
306
308
  <li>
307
- <img data-src="images/slider3.jpg" alt="" data-width="400" data-height="600" uk-img="target: !.uk-slider-items">
309
+ <img data-src="images/slider3.jpg" alt="" width="400" height="600" uk-img="target: !.uk-slider-items">
308
310
  <div class="uk-position-center uk-panel"><h1 class="uk-transition-slide-bottom-small">3</h1></div>
309
311
  </li>
310
312
  <li>
311
- <img data-src="images/slider4.jpg" alt="" data-width="400" data-height="600" uk-img="target: !.uk-slider-items">
313
+ <img data-src="images/slider4.jpg" alt="" width="400" height="600" uk-img="target: !.uk-slider-items">
312
314
  <div class="uk-position-center uk-panel"><h1 class="uk-transition-slide-bottom-small">4</h1></div>
313
315
  </li>
314
316
  <li>
315
- <img data-src="images/slider5.jpg" alt="" data-width="400" data-height="600" uk-img="target: !.uk-slider-items">
317
+ <img data-src="images/slider5.jpg" alt="" width="400" height="600" uk-img="target: !.uk-slider-items">
316
318
  <div class="uk-position-center uk-panel"><h1 class="uk-transition-slide-bottom-small">5</h1></div>
317
319
  </li>
318
320
  <li>
319
- <img data-src="images/slider1.jpg" alt="" data-width="400" data-height="600" uk-img="target: !.uk-slider-items">
321
+ <img data-src="images/slider1.jpg" alt="" width="400" height="600" uk-img="target: !.uk-slider-items">
320
322
  <div class="uk-position-center uk-panel"><h1 class="uk-transition-slide-bottom-small">6</h1></div>
321
323
  </li>
322
324
  <li>
323
- <img data-src="images/slider2.jpg" alt="" data-width="400" data-height="600" uk-img="target: !.uk-slider-items">
325
+ <img data-src="images/slider2.jpg" alt="" width="400" height="600" uk-img="target: !.uk-slider-items">
324
326
  <div class="uk-position-center uk-panel"><h1 class="uk-transition-slide-bottom-small">7</h1></div>
325
327
  </li>
326
328
  <li>
327
- <img data-src="images/slider3.jpg" alt="" data-width="400" data-height="600" uk-img="target: !.uk-slider-items">
329
+ <img data-src="images/slider3.jpg" alt="" width="400" height="600" uk-img="target: !.uk-slider-items">
328
330
  <div class="uk-position-center uk-panel"><h1 class="uk-transition-slide-bottom-small">8</h1></div>
329
331
  </li>
330
332
  <li>
331
- <img data-src="images/slider4.jpg" alt="" data-width="400" data-height="600" uk-img="target: !.uk-slider-items">
333
+ <img data-src="images/slider4.jpg" alt="" width="400" height="600" uk-img="target: !.uk-slider-items">
332
334
  <div class="uk-position-center uk-panel"><h1 class="uk-transition-slide-bottom-small">9</h1></div>
333
335
  </li>
334
336
  <li>
335
- <img data-src="images/slider5.jpg" alt="" data-width="400" data-height="600" uk-img="target: !.uk-slider-items">
337
+ <img data-src="images/slider5.jpg" alt="" width="400" height="600" uk-img="target: !.uk-slider-items">
336
338
  <div class="uk-position-center uk-panel"><h1 class="uk-transition-slide-bottom-small">10</h1></div>
337
339
  </li>
338
340
  </ul>
@@ -365,28 +367,10 @@
365
367
  <td>The image's `src` attribute.</td>
366
368
  </tr>
367
369
  <tr>
368
- <td><code>dataSrcset</code></td>
369
- <td>String</td>
370
- <td>false</td>
371
- <td>The image's `srcset` attribute.</td>
372
- </tr>
373
- <tr>
374
- <td><code>sizes</code></td>
375
- <td>String</td>
376
- <td>false</td>
377
- <td>The image's `sizes` attribute.</td>
378
- </tr>
379
- <tr>
380
- <td><code>width</code></td>
370
+ <td><code>dataSources</code></td>
381
371
  <td>String</td>
382
- <td>false</td>
383
- <td>The image's `width` attribute. It will be used to determine the placeholder's width and the images position in the document.</td>
384
- </tr>
385
- <tr>
386
- <td><code>height</code></td>
387
- <td>String</td>
388
- <td>false</td>
389
- <td>The image's `height` attribute. It will be used to determine the placeholder's height and the images position in the document.</td>
372
+ <td>''</td>
373
+ <td>The image's sources. This option is used for background images only. The sources attributes be passed in `key: value;` format for a single source. For multiple sources in JSON format.</td>
390
374
  </tr>
391
375
  <tr>
392
376
  <td><code>offsetTop</code></td>
Binary file
Binary file
@@ -10,7 +10,7 @@
10
10
 
11
11
  <body style="padding-bottom: 100vh;">
12
12
 
13
- <div class="uk-section uk-section-primary uk-position-z-index-negative uk-flex uk-flex-center uk-flex-middle uk-text-center" uk-sticky="bottom: +* +*" uk-height-viewport>
13
+ <div class="uk-section uk-section-primary uk-position-z-index-negative uk-flex uk-flex-center uk-flex-middle uk-text-center" uk-sticky="position: auto; bottom: +* +*" uk-height-viewport>
14
14
  <div class="uk-container">
15
15
 
16
16
  <h1 class="uk-heading-2xlarge">Sticky Section</h1>
package/tests/sticky.html CHANGED
@@ -57,14 +57,25 @@
57
57
  </div>
58
58
 
59
59
  <p id="hash" class="uk-margin-large">Lorem ipsum dolor sit amet, consectetur adipiscing elit, sed do eiusmod tempor incididunt ut labore et dolore magna aliqua. Ut enim ad minim veniam, quis nostrud exercitation ullamco laboris nisi ut aliquip ex ea commodo consequat. Duis aute irure dolor in reprehenderit in voluptate velit esse cillum dolore eu fugiat nulla pariatur. Excepteur sint occaecat cupidatat non proident, sunt in culpa qui officia deserunt mollit anim id est laborum.</p>
60
+
61
+ <div class="viewport uk-margin">
62
+ <div class="uk-grid uk-child-width-1-6" uk-height-viewport>
63
+ <div>
64
+
65
+ <div class="uk-card uk-card-primary uk-card-body" uk-sticky="position: bottom; bottom: !.viewport">Sticky bottom</div>
66
+
67
+ </div>
68
+ </div>
69
+ </div>
70
+
60
71
  </div>
61
72
  <div class="uk-width-1-6">
62
73
  <div class="viewport" style="min-height: 200vh;">
63
74
  <div>
64
- <div class="uk-card uk-card-primary uk-card-body" style="height: 120vh" uk-sticky="bottom: !.viewport">
75
+ <div class="uk-card uk-card-primary uk-card-body" uk-sticky="bottom: !.viewport">
65
76
  <p>Oversized Content</p>
66
77
 
67
- <p>Lorem ipsum dolor sit amet, consectetur adipiscing elit, sed do eiusmod tempor incididunt ut labore et dolore magna aliqua. Ut enim ad minim veniam, quis nostrud exercitation ullamco laboris nisi ut aliquip ex ea commodo consequat. Duis aute irure dolor in reprehenderit in voluptate velit esse cillum dolore eu fugiat nulla pariatur. Excepteur sint occaecat cupidatat non proident, sunt in culpa qui officia deserunt mollit anim id est laborum.</p>
78
+ <p>Lorem ipsum dolor sit amet, consectetur adipiscing elit, sed do eiusmod tempor incididunt ut labore et dolore magna aliqua. Ut enim ad minim veniam, quis nostrud exercitation ullamco laboris nisi ut aliquip ex ea commodo consequat. Duis aute irure dolor in reprehenderit in voluptate velit esse cillum dolore eu fugiat nulla pariatur. Excepteur sint occaecat cupidatat non proident, sunt in culpa qui officia deserunt mollit anim id est laborum. Lorem ipsum dolor sit amet, consectetur adipiscing elit, sed do eiusmod tempor incididunt ut labore et dolore magna aliqua</p>
68
79
  </div>
69
80
  </div>
70
81
  </div>
@@ -106,7 +117,7 @@
106
117
  <td><code>offset</code></td>
107
118
  <td>String</td>
108
119
  <td>0</td>
109
- <td>The offset the Sticky should be fixed to.</td>
120
+ <td>The offset the Sticky should be fixed to. It supports basic mathematics operands + and -. (e.g. 50vh + 50%)</td>
110
121
  </tr>
111
122
  <tr>
112
123
  <td><code>animation</code></td>