uikit 3.23.13 → 3.23.14-dev.be820cd99

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 (128) hide show
  1. package/.prettierignore +1 -0
  2. package/CHANGELOG.md +36 -0
  3. package/dist/css/uikit-core-rtl.css +301 -111
  4. package/dist/css/uikit-core-rtl.min.css +1 -1
  5. package/dist/css/uikit-core.css +301 -111
  6. package/dist/css/uikit-core.min.css +1 -1
  7. package/dist/css/uikit-rtl.css +305 -111
  8. package/dist/css/uikit-rtl.min.css +1 -1
  9. package/dist/css/uikit.css +305 -111
  10. package/dist/css/uikit.min.css +1 -1
  11. package/dist/js/components/countdown.js +1 -1
  12. package/dist/js/components/countdown.min.js +1 -1
  13. package/dist/js/components/filter.js +49 -23
  14. package/dist/js/components/filter.min.js +1 -1
  15. package/dist/js/components/lightbox-panel.js +19 -14
  16. package/dist/js/components/lightbox-panel.min.js +1 -1
  17. package/dist/js/components/lightbox.js +19 -14
  18. package/dist/js/components/lightbox.min.js +1 -1
  19. package/dist/js/components/notification.js +1 -1
  20. package/dist/js/components/notification.min.js +1 -1
  21. package/dist/js/components/parallax.js +2 -2
  22. package/dist/js/components/parallax.min.js +1 -1
  23. package/dist/js/components/slider-parallax.js +2 -2
  24. package/dist/js/components/slider-parallax.min.js +1 -1
  25. package/dist/js/components/slider.js +8 -3
  26. package/dist/js/components/slider.min.js +1 -1
  27. package/dist/js/components/slideshow-parallax.js +2 -2
  28. package/dist/js/components/slideshow-parallax.min.js +1 -1
  29. package/dist/js/components/slideshow.js +8 -3
  30. package/dist/js/components/slideshow.min.js +1 -1
  31. package/dist/js/components/sortable.js +48 -22
  32. package/dist/js/components/sortable.min.js +1 -1
  33. package/dist/js/components/tooltip.js +3 -3
  34. package/dist/js/components/tooltip.min.js +1 -1
  35. package/dist/js/components/upload.js +2 -2
  36. package/dist/js/components/upload.min.js +1 -1
  37. package/dist/js/uikit-core.js +136 -63
  38. package/dist/js/uikit-core.min.js +1 -1
  39. package/dist/js/uikit-icons.js +1 -1
  40. package/dist/js/uikit-icons.min.js +1 -1
  41. package/dist/js/uikit.js +185 -90
  42. package/dist/js/uikit.min.js +1 -1
  43. package/eslint.config.mjs +1 -1
  44. package/package.json +1 -1
  45. package/src/images/backgrounds/form-checkbox.svg +2 -2
  46. package/src/images/components/navbar-toggle-icon.svg +14 -7
  47. package/src/js/api/options.js +1 -1
  48. package/src/js/components/lightbox-panel.js +6 -4
  49. package/src/js/components/upload.js +1 -3
  50. package/src/js/core/drop.js +3 -8
  51. package/src/js/core/dropnav.js +4 -4
  52. package/src/js/core/img.js +1 -1
  53. package/src/js/core/index.js +1 -0
  54. package/src/js/core/navbar.js +3 -5
  55. package/src/js/core/overflow-fade.js +67 -0
  56. package/src/js/core/scrollspy.js +10 -10
  57. package/src/js/core/sticky.js +18 -16
  58. package/src/js/core/toggle.js +3 -5
  59. package/src/js/core/video.js +36 -10
  60. package/src/js/mixin/internal/animate-fade.js +32 -15
  61. package/src/js/mixin/internal/animate-slide.js +27 -9
  62. package/src/js/mixin/modal.js +3 -4
  63. package/src/js/mixin/slider.js +3 -1
  64. package/src/js/mixin/togglable.js +1 -1
  65. package/src/js/util/animation.js +3 -4
  66. package/src/js/util/await.js +7 -0
  67. package/src/js/util/player.js +1 -3
  68. package/src/js/util/scroll.js +2 -2
  69. package/src/js/util/selector.js +1 -1
  70. package/src/js/util/viewport.js +3 -1
  71. package/src/less/components/base.less +19 -4
  72. package/src/less/components/card.less +40 -1
  73. package/src/less/components/countdown.less +4 -42
  74. package/src/less/components/form.less +87 -67
  75. package/src/less/components/heading.less +0 -84
  76. package/src/less/components/icon.less +44 -0
  77. package/src/less/components/navbar.less +23 -9
  78. package/src/less/components/position.less +1 -1
  79. package/src/less/components/section.less +33 -0
  80. package/src/less/components/subnav.less +1 -1
  81. package/src/less/components/utility.less +45 -0
  82. package/src/less/components/visibility.less +1 -1
  83. package/src/less/components/width.less +0 -5
  84. package/src/less/theme/card.less +13 -0
  85. package/src/less/theme/icon.less +14 -0
  86. package/src/scss/components/base.scss +19 -4
  87. package/src/scss/components/card.scss +35 -1
  88. package/src/scss/components/countdown.scss +2 -40
  89. package/src/scss/components/form.scss +73 -55
  90. package/src/scss/components/heading.scss +0 -83
  91. package/src/scss/components/icon.scss +22 -0
  92. package/src/scss/components/navbar.scss +23 -9
  93. package/src/scss/components/position.scss +1 -1
  94. package/src/scss/components/section.scss +33 -0
  95. package/src/scss/components/subnav.scss +1 -1
  96. package/src/scss/components/utility.scss +45 -0
  97. package/src/scss/components/visibility.scss +1 -1
  98. package/src/scss/components/width.scss +0 -15
  99. package/src/scss/mixins-theme.scss +28 -8
  100. package/src/scss/mixins.scss +25 -8
  101. package/src/scss/variables-theme.scss +27 -30
  102. package/src/scss/variables.scss +25 -30
  103. package/tests/article.html +7 -7
  104. package/tests/base.html +13 -13
  105. package/tests/card.html +9 -1
  106. package/tests/column.html +1 -1
  107. package/tests/countdown.html +595 -8
  108. package/tests/cover.html +7 -13
  109. package/tests/dropbar.html +3 -3
  110. package/tests/dropdown.html +13 -13
  111. package/tests/dropnav.html +9 -9
  112. package/tests/form.html +56 -3
  113. package/tests/icon.html +31 -0
  114. package/tests/index.html +68 -58
  115. package/tests/js/index.js +76 -83
  116. package/tests/lightbox.html +4 -4
  117. package/tests/link.html +71 -8
  118. package/tests/modal.html +1 -1
  119. package/tests/navbar.html +32 -32
  120. package/tests/notification.html +5 -5
  121. package/tests/search.html +3 -3
  122. package/tests/slideshow.html +3 -3
  123. package/tests/sticky-navbar.html +72 -72
  124. package/tests/subnav.html +106 -2
  125. package/tests/tab.html +68 -21
  126. package/tests/table.html +8 -8
  127. package/tests/utility.html +159 -1
  128. package/tests/video.html +137 -10
@@ -1,17 +1,21 @@
1
1
  import {
2
2
  attr,
3
3
  children,
4
+ clamp,
4
5
  css,
5
6
  dimensions,
6
7
  includes,
7
8
  index,
9
+ isInView,
8
10
  isVisible,
11
+ offsetViewport,
9
12
  parent,
10
13
  position,
11
14
  resetProps,
12
15
  Transition,
13
16
  trigger,
14
17
  } from 'uikit-util';
18
+ import { awaitFrame } from '../../util/await';
15
19
 
16
20
  export default async function (action, target, duration) {
17
21
  await awaitFrame();
@@ -22,6 +26,7 @@ export default async function (action, target, duration) {
22
26
  const currentProps = nodes.map((el) => getProps(el, true));
23
27
  const targetProps = { ...css(target, ['height', 'padding']), display: 'block' };
24
28
 
29
+ const transitionNodes = nodes.filter((node) => isInView(node));
25
30
  const targets = nodes.concat(target);
26
31
 
27
32
  // Cancel previous animations
@@ -34,7 +39,10 @@ export default async function (action, target, duration) {
34
39
  await action();
35
40
 
36
41
  // Find new nodes
37
- nodes = nodes.concat(children(target).filter((el) => !includes(nodes, el)));
42
+
43
+ const newNodes = children(target).filter((el) => !includes(nodes, el));
44
+
45
+ nodes = nodes.concat(newNodes);
38
46
 
39
47
  // Wait for update to propagate
40
48
  await Promise.resolve();
@@ -48,6 +56,8 @@ export default async function (action, target, duration) {
48
56
  const [propsTo, propsFrom] = getTransitionProps(target, nodes, currentProps);
49
57
  const attrsTo = nodes.map((el) => ({ style: attr(el, 'style') }));
50
58
 
59
+ transitionNodes.push(...nodes.filter((node) => isInView(node)));
60
+
51
61
  // Reset to previous state
52
62
  nodes.forEach((el, i) => propsFrom[i] && css(el, propsFrom[i]));
53
63
  css(target, targetProps);
@@ -59,8 +69,12 @@ export default async function (action, target, duration) {
59
69
  await awaitFrame();
60
70
 
61
71
  const transitions = nodes
62
- .map((el, i) => parent(el) === target && Transition.start(el, propsTo[i], duration, 'ease'))
63
- .concat(Transition.start(target, targetPropsTo, duration, 'ease'));
72
+ .map((el, i) => {
73
+ if (parent(el) === target && transitionNodes.includes(el)) {
74
+ return Transition.start(el, propsTo[i], duration, 'ease', !newNodes.includes(el));
75
+ }
76
+ })
77
+ .concat(Transition.start(target, targetPropsTo, duration, 'ease', true));
64
78
 
65
79
  try {
66
80
  await Promise.all(transitions);
@@ -71,7 +85,7 @@ export default async function (action, target, duration) {
71
85
  }
72
86
  });
73
87
  attr(target, 'style', targetStyle);
74
- } catch (e) {
88
+ } catch {
75
89
  attr(nodes, 'style', '');
76
90
  resetProps(target, targetProps);
77
91
  }
@@ -131,15 +145,19 @@ function getTransitionProps(target, nodes, currentProps) {
131
145
  function getPositionWithMargin(el) {
132
146
  const { height, width } = dimensions(el);
133
147
 
148
+ let { top, left } = position(el);
149
+
150
+ const viewport = offsetViewport(el.ownerDocument);
151
+
152
+ top = clamp(top, viewport.top - height - viewport.height, viewport.bottom + viewport.height);
153
+ left = clamp(left, viewport.left - width - viewport.width, viewport.right + viewport.width);
154
+
134
155
  return {
135
156
  height,
136
157
  width,
158
+ top,
159
+ left,
137
160
  transform: '',
138
- ...position(el),
139
161
  ...css(el, ['marginTop', 'marginLeft']),
140
162
  };
141
163
  }
142
-
143
- export function awaitFrame() {
144
- return new Promise((resolve) => requestAnimationFrame(resolve));
145
- }
@@ -18,6 +18,7 @@ import {
18
18
  removeClass,
19
19
  toFloat,
20
20
  } from 'uikit-util';
21
+ import { awaitFrame } from '../util/await';
21
22
  import { preventBackgroundScroll } from '../util/scroll';
22
23
  import Class from './class';
23
24
  import Container from './container';
@@ -215,12 +216,10 @@ export default {
215
216
  return this.isToggled() ? this.hide() : this.show();
216
217
  },
217
218
 
218
- show() {
219
+ async show() {
219
220
  if (this.container && parent(this.$el) !== this.container) {
220
221
  append(this.container, this.$el);
221
- return new Promise((resolve) =>
222
- requestAnimationFrame(() => this.show().then(resolve)),
223
- );
222
+ await awaitFrame();
224
223
  }
225
224
 
226
225
  return this.toggleElement(this.$el, true, animate);
@@ -10,6 +10,7 @@ import {
10
10
  removeClass,
11
11
  trigger,
12
12
  } from 'uikit-util';
13
+ import { awaitFrame } from '../util/await';
13
14
  import I18n from './i18n';
14
15
  import SliderAutoplay from './slider-autoplay';
15
16
  import SliderDrag from './slider-drag';
@@ -160,8 +161,9 @@ export default {
160
161
  stack.shift();
161
162
  this._transitioner = null;
162
163
 
164
+ await awaitFrame();
163
165
  if (stack.length) {
164
- requestAnimationFrame(() => stack.length && this.show(stack.shift(), true));
166
+ this.show(stack.shift(), true);
165
167
  }
166
168
  },
167
169
 
@@ -97,7 +97,7 @@ export default {
97
97
  }),
98
98
  );
99
99
  return true;
100
- } catch (e) {
100
+ } catch {
101
101
  return false;
102
102
  }
103
103
  },
@@ -7,15 +7,14 @@ const clsTransition = 'uk-transition';
7
7
  const transitionEnd = 'transitionend';
8
8
  const transitionCanceled = 'transitioncanceled';
9
9
 
10
- function transition(element, props, duration = 400, timing = 'linear') {
10
+ function transition(element, props, duration = 400, timing = 'linear', skipReflow) {
11
11
  duration = Math.round(duration);
12
12
  return Promise.all(
13
13
  toNodes(element).map(
14
14
  (element) =>
15
15
  new Promise((resolve, reject) => {
16
- for (const name in props) {
17
- // Force reflow: transition won't run for previously hidden element
18
- css(element, name);
16
+ if (!skipReflow) {
17
+ element.offsetHeight; // force reflow
19
18
  }
20
19
 
21
20
  const timer = setTimeout(() => trigger(element, transitionEnd), duration);
@@ -0,0 +1,7 @@
1
+ export function awaitFrame() {
2
+ return new Promise((resolve) => requestAnimationFrame(resolve));
3
+ }
4
+
5
+ export function awaitTimeout(timeout) {
6
+ return new Promise((resolve) => setTimeout(resolve, timeout));
7
+ }
@@ -87,9 +87,7 @@ function enableApi(el) {
87
87
  (youtube && data?.id === id && data.event === 'onReady') ||
88
88
  (vimeo && Number(data?.player_id) === id)
89
89
  );
90
- } catch (e) {
91
- // noop
92
- }
90
+ } catch {}
93
91
  });
94
92
 
95
93
  el.src = `${el.src}${includes(el.src, '?') ? '&' : '?'}${
@@ -1,4 +1,4 @@
1
- import { css, getEventPos, matches, on, once, resetProps, scrollParents, width } from 'uikit-util';
1
+ import { css, getEventPos, matches, on, once, resetProps, scrollParents } from 'uikit-util';
2
2
 
3
3
  let prevented;
4
4
  export function preventBackgroundScroll(el) {
@@ -53,7 +53,7 @@ export function preventBackgroundScroll(el) {
53
53
  const props = {
54
54
  overflowY: CSS.supports('overflow', 'clip') ? 'clip' : 'hidden',
55
55
  touchAction: 'none',
56
- paddingRight: width(window) - scrollingElement.clientWidth || '',
56
+ scrollbarGutter: 'stable',
57
57
  };
58
58
  css(scrollingElement, props);
59
59
  return () => {
@@ -114,7 +114,7 @@ function _query(selector, context = document, queryFn) {
114
114
  function _doQuery(context, queryFn, selector) {
115
115
  try {
116
116
  return context[queryFn](selector);
117
- } catch (e) {
117
+ } catch {
118
118
  return null;
119
119
  }
120
120
  }
@@ -208,10 +208,12 @@ export function offsetViewport(scrollElement) {
208
208
  }
209
209
 
210
210
  export function getCoveringElement(target) {
211
+ const { document } = toWindow(target);
212
+ target = target || document.body;
211
213
  const { left, width, top } = dimensions(target);
212
214
  for (const position of top ? [0, top] : [0]) {
213
215
  let coverEl;
214
- for (const el of toWindow(target).document.elementsFromPoint(left + width / 2, position)) {
216
+ for (const el of document.elementsFromPoint(left + width / 2, position)) {
215
217
  if (
216
218
  !el.contains(target) &&
217
219
  // If e.g. Offcanvas is not yet closed
@@ -139,6 +139,14 @@ a:hover,
139
139
  .hook-base-link-hover();
140
140
  }
141
141
 
142
+ /*
143
+ * Fix text underline offset if `vertical-align`is set to `middle`
144
+ */
145
+
146
+ a:has(.uk-text-middle),
147
+ .uk-link:has(.uk-text-middle),
148
+ .uk-link-toggle:hover .uk-link:has(.uk-text-middle) { text-underline-offset: 0.1875em; }
149
+
142
150
 
143
151
  /* Text-level semantics
144
152
  ========================================================================== */
@@ -250,8 +258,11 @@ video { vertical-align: middle; }
250
258
 
251
259
  /*
252
260
  * 1. Constrain the element to its parent width.
253
- * 2. Preserve the intrinsic aspect ratio and auto-scale the height of an image if the `height` attribute is present.
254
- * 3. Take border and padding into account.
261
+ * 2. Take border and padding into account.
262
+ * 3. Reset `height` attribute if present to scale the height based on the intrinsic aspect ratio.
263
+ * 4. Scale height based on the extrinsic aspect ratio. Works only in Chrome yet.
264
+ * 5. Size image to fill the element's content box.
265
+ * Note: Add `iframe` as soon as `attr` is supported in all browsers and remove `uk-responsive`.
255
266
  */
256
267
 
257
268
  canvas,
@@ -261,9 +272,13 @@ video {
261
272
  /* 1 */
262
273
  max-width: 100%;
263
274
  /* 2 */
264
- height: auto;
265
- /* 3 */
266
275
  box-sizing: border-box;
276
+ /* 3 */
277
+ height: auto;
278
+ /* 4 */
279
+ aspect-ratio: ~'attr(width type(<number>)) / attr(height type(<number>))';
280
+ /* 5 */
281
+ object-fit: cover;
267
282
  }
268
283
 
269
284
  /*
@@ -14,6 +14,7 @@
14
14
  // `uk-card-default`
15
15
  // `uk-card-primary`
16
16
  // `uk-card-secondary`
17
+ // `uk-card-overlay`
17
18
  // `uk-card-small`
18
19
  // `uk-card-large`
19
20
  //
@@ -74,6 +75,12 @@
74
75
  @card-secondary-hover-background: darken(@card-secondary-background, 5%);
75
76
  @card-secondary-color-mode: light;
76
77
 
78
+ @card-overlay-background: fade(@global-background, 80%);
79
+ @card-overlay-color: @global-color;
80
+ @card-overlay-title-color: @global-emphasis-color;
81
+ @card-overlay-hover-background: fadein(@card-overlay-background, 10%);
82
+ @card-overlay-color-mode: dark;
83
+
77
84
  @card-small-body-padding-horizontal: @global-margin;
78
85
  @card-small-body-padding-vertical: @global-margin;
79
86
  @card-small-header-padding-horizontal: @global-margin;
@@ -223,7 +230,7 @@
223
230
  /* Hover modifier
224
231
  ========================================================================== */
225
232
 
226
- .uk-card-hover:not(.uk-card-default):not(.uk-card-primary):not(.uk-card-secondary):hover {
233
+ .uk-card-hover:not(.uk-card-default, .uk-card-primary, .uk-card-secondary, .uk-card-overlay):hover {
227
234
  background-color: @card-hover-background;
228
235
  .hook-card-hover();
229
236
  }
@@ -323,6 +330,35 @@
323
330
  .uk-card-secondary > :not([class*="uk-card-media"]):extend(.uk-dark all) when (@card-secondary-color-mode = dark) {}
324
331
 
325
332
 
333
+ /*
334
+ * Overlay
335
+ */
336
+
337
+ .uk-card-overlay {
338
+ --uk-inverse: @card-overlay-color-mode;
339
+ background-color: @card-overlay-background;
340
+ color: @card-overlay-color;
341
+ .hook-card-overlay();
342
+ }
343
+
344
+ .uk-card-overlay .uk-card-title {
345
+ color: @card-overlay-title-color;
346
+ .hook-card-overlay-title();
347
+ }
348
+
349
+ .uk-card-overlay.uk-card-hover:hover {
350
+ background-color: @card-overlay-hover-background;
351
+ .hook-card-overlay-hover();
352
+ }
353
+
354
+
355
+ // Color Mode
356
+ .uk-card-overlay.uk-card-body:extend(.uk-light all) when (@card-overlay-color-mode = light) {}
357
+ .uk-card-overlay > :not([class*="uk-card-media"]):extend(.uk-light all) when (@card-overlay-color-mode = light) {}
358
+ .uk-card-overlay.uk-card-body:extend(.uk-dark all) when (@card-overlay-color-mode = dark) {}
359
+ .uk-card-overlay > :not([class*="uk-card-media"]):extend(.uk-dark all) when (@card-overlay-color-mode = dark) {}
360
+
361
+
326
362
  /* Size modifier
327
363
  ========================================================================== */
328
364
 
@@ -380,6 +416,9 @@
380
416
  .hook-card-secondary() {}
381
417
  .hook-card-secondary-title() {}
382
418
  .hook-card-secondary-hover() {}
419
+ .hook-card-overlay() {}
420
+ .hook-card-overlay-title() {}
421
+ .hook-card-overlay-hover() {}
383
422
  .hook-card-misc() {}
384
423
 
385
424
 
@@ -13,15 +13,8 @@
13
13
  // Variables
14
14
  // ========================================================================
15
15
 
16
- @countdown-number-line-height: 0.8;
17
- @countdown-number-font-size: 2rem; // 32px
18
- @countdown-number-font-size-s: 4rem; // 64px
19
- @countdown-number-font-size-m: 6rem; // 96px
20
-
21
- @countdown-separator-line-height: 1.6;
22
- @countdown-separator-font-size: 1rem; // 16px
23
- @countdown-separator-font-size-s: 2rem; // 32px
24
- @countdown-separator-font-size-m: 3rem; // 48px
16
+ @countdown-separator-line-height: 2;
17
+ @countdown-separator-font-size: 0.5em;
25
18
 
26
19
 
27
20
  /* ========================================================================
@@ -29,6 +22,7 @@
29
22
  ========================================================================== */
30
23
 
31
24
  .uk-countdown {
25
+ margin: 0;
32
26
  .hook-countdown();
33
27
  }
34
28
 
@@ -45,35 +39,17 @@
45
39
  /* Number
46
40
  ========================================================================== */
47
41
 
48
-
49
42
  /*
50
43
  * 1. Make numbers all of the same size to prevent jumping. Must be supported by the font.
51
- * 2. Style
52
44
  */
53
45
 
54
46
  .uk-countdown-number {
47
+ margin: 0;
55
48
  /* 1 */
56
49
  font-variant-numeric: tabular-nums;
57
- /* 2 */
58
- font-size: @countdown-number-font-size;
59
- line-height: @countdown-number-line-height;
60
50
  .hook-countdown-number();
61
51
  }
62
52
 
63
- /* Phone landscape and bigger */
64
- @media (min-width: @breakpoint-small) {
65
-
66
- .uk-countdown-number { font-size: @countdown-number-font-size-s; }
67
-
68
- }
69
-
70
- /* Tablet landscape and bigger */
71
- @media (min-width: @breakpoint-medium) {
72
-
73
- .uk-countdown-number { font-size: @countdown-number-font-size-m; }
74
-
75
- }
76
-
77
53
 
78
54
  /* Separator
79
55
  ========================================================================== */
@@ -84,20 +60,6 @@
84
60
  .hook-countdown-separator();
85
61
  }
86
62
 
87
- /* Phone landscape and bigger */
88
- @media (min-width: @breakpoint-small) {
89
-
90
- .uk-countdown-separator { font-size: @countdown-separator-font-size-s; }
91
-
92
- }
93
-
94
- /* Tablet landscape and bigger */
95
- @media (min-width: @breakpoint-medium) {
96
-
97
- .uk-countdown-separator { font-size: @countdown-separator-font-size-m; }
98
-
99
- }
100
-
101
63
 
102
64
  /* Label
103
65
  ========================================================================== */
@@ -51,18 +51,6 @@
51
51
 
52
52
  @form-placeholder-color: @global-muted-color;
53
53
 
54
- @form-small-height: @global-control-small-height;
55
- @form-small-padding-horizontal: 8px;
56
- @form-small-padding-vertical: round(@form-small-padding-horizontal * 0.6);
57
- @form-small-line-height: @form-small-height;
58
- @form-small-font-size: @global-small-font-size;
59
-
60
- @form-large-height: @global-control-large-height;
61
- @form-large-padding-horizontal: 12px;
62
- @form-large-padding-vertical: round(@form-large-padding-horizontal * 0.6);
63
- @form-large-line-height: @form-large-height;
64
- @form-large-font-size: @global-medium-font-size;
65
-
66
54
  @form-danger-color: @global-danger-background;
67
55
  @form-success-color: @global-success-background;
68
56
 
@@ -93,6 +81,20 @@
93
81
  @form-radio-disabled-background: @global-muted-background;
94
82
  @form-radio-disabled-icon-color: @global-muted-color;
95
83
 
84
+ @form-small-font-size: @global-small-font-size;
85
+ @form-small-height: @global-control-small-height;
86
+ @form-small-padding-horizontal: 8px;
87
+ @form-small-padding-vertical: round(@form-small-padding-horizontal * 0.6);
88
+ @form-small-line-height: @form-small-height;
89
+ @form-small-radio-size: 14px;
90
+
91
+ @form-large-font-size: @global-medium-font-size;
92
+ @form-large-height: @global-control-large-height;
93
+ @form-large-padding-horizontal: 12px;
94
+ @form-large-padding-vertical: round(@form-large-padding-horizontal * 0.6);
95
+ @form-large-line-height: @form-large-height;
96
+ @form-large-radio-size: 22px;
97
+
96
98
  @form-legend-font-size: @global-large-font-size;
97
99
  @form-legend-line-height: 1.4;
98
100
 
@@ -268,23 +270,32 @@
268
270
 
269
271
  /*
270
272
  * Single-line
271
- * 1. Allow any element to look like an `input` or `select` element
272
- * 2. Make sure line-height is not larger than height
273
- * Also needed to center the text vertically
274
273
  */
275
274
 
276
275
  .uk-input,
277
276
  .uk-select:not([multiple]):not([size]) {
278
277
  height: @form-height;
279
278
  vertical-align: middle;
280
- /* 1 */
281
- display: inline-block;
282
279
  .hook-form-single-line();
283
280
  }
284
281
 
285
- /* 2 */
286
- .uk-input:not(input),
287
- .uk-select:not(select) { line-height: @form-line-height; }
282
+ /*
283
+ * 1. Allow any element to look like an `input` or `select` element
284
+ * 2. Make sure line-height is not larger than height. Also needed to center the text vertically
285
+ * 3. Prevent text from wrapping onto multiple lines, and truncate with an ellipsis
286
+ */
287
+
288
+ .uk-input:where(:not(input)),
289
+ .uk-select:where(:not(select)) {
290
+ /* 1 */
291
+ display: inline-block;
292
+ /* 2 */
293
+ line-height: @form-line-height;
294
+ /* 3 */
295
+ overflow: hidden;
296
+ text-overflow: ellipsis;
297
+ white-space: nowrap;
298
+ }
288
299
 
289
300
  /*
290
301
  * Multi-line
@@ -330,50 +341,6 @@
330
341
  .uk-textarea::placeholder { color: @form-placeholder-color; }
331
342
 
332
343
 
333
- /* Style modifier (`uk-input`, `uk-select` and `uk-textarea`)
334
- ========================================================================== */
335
-
336
- /*
337
- * Small
338
- */
339
-
340
- .uk-form-small { font-size: @form-small-font-size; }
341
-
342
- /* Single-line */
343
- .uk-form-small:not(textarea):not([multiple]):not([size]) {
344
- height: @form-small-height;
345
- padding-left: @form-small-padding-horizontal;
346
- padding-right: @form-small-padding-horizontal;
347
- }
348
-
349
- /* Multi-line */
350
- textarea.uk-form-small,
351
- [multiple].uk-form-small,
352
- [size].uk-form-small { padding: @form-small-padding-vertical @form-small-padding-horizontal; }
353
-
354
- .uk-form-small:not(select):not(input):not(textarea) { line-height: @form-small-line-height; }
355
-
356
- /*
357
- * Large
358
- */
359
-
360
- .uk-form-large { font-size: @form-large-font-size; }
361
-
362
- /* Single-line */
363
- .uk-form-large:not(textarea):not([multiple]):not([size]) {
364
- height: @form-large-height;
365
- padding-left: @form-large-padding-horizontal;
366
- padding-right: @form-large-padding-horizontal;
367
- }
368
-
369
- /* Multi-line */
370
- textarea.uk-form-large,
371
- [multiple].uk-form-large,
372
- [size].uk-form-large { padding: @form-large-padding-vertical @form-large-padding-horizontal; }
373
-
374
- .uk-form-large:not(select):not(input):not(textarea) { line-height: @form-large-line-height; }
375
-
376
-
377
344
  /* Style modifier (`uk-input`, `uk-select` and `uk-textarea`)
378
345
  ========================================================================== */
379
346
 
@@ -489,7 +456,7 @@ select.uk-form-width-xsmall { width: (@form-width-xsmall + 25px); }
489
456
  * 3. Vertical alignment
490
457
  * 4. Remove default style
491
458
  * 5. Fix black background on iOS
492
- * 6. Center icons
459
+ * 6. Cover icons
493
460
  */
494
461
 
495
462
  .uk-radio,
@@ -509,8 +476,7 @@ select.uk-form-width-xsmall { width: (@form-width-xsmall + 25px); }
509
476
  /* 5 */
510
477
  background-color: @form-radio-background;
511
478
  /* 6 */
512
- background-repeat: no-repeat;
513
- background-position: 50% 50%;
479
+ background-size: cover;
514
480
  .hook-form-radio();
515
481
  }
516
482
 
@@ -566,6 +532,60 @@ select.uk-form-width-xsmall { width: (@form-width-xsmall + 25px); }
566
532
  .uk-checkbox:disabled:indeterminate { .svg-fill(@internal-form-checkbox-indeterminate-image, "#000", @form-radio-disabled-icon-color); }
567
533
 
568
534
 
535
+ /* Style modifier (`uk-input`, `uk-select`, `uk-textarea`, `uk-radio`, `uk-checkbox`)
536
+ ========================================================================== */
537
+
538
+ /*
539
+ * Small
540
+ */
541
+
542
+ .uk-form-small:is(.uk-input, .uk-search-input, .uk-select, .uk-textarea) { font-size: @form-small-font-size; }
543
+
544
+ /* Single-line */
545
+ .uk-form-small:is(.uk-input, .uk-search-input, .uk-select:not([multiple]):not([size])) {
546
+ height: @form-small-height;
547
+ padding-left: @form-small-padding-horizontal;
548
+ padding-right: @form-small-padding-horizontal;
549
+ }
550
+
551
+ /* Multi-line */
552
+ .uk-form-small:is(.uk-select[multiple], .uk-select[size], .uk-textarea) { padding: @form-small-padding-vertical @form-small-padding-horizontal; }
553
+
554
+ /* Any element */
555
+ .uk-form-small:not(select):not(input):not(textarea):not([type="radio"]):not([type="checkbox"]) { line-height: @form-small-line-height; }
556
+
557
+ /* Radio + Checkbox */
558
+ .uk-form-small:is(.uk-radio, .uk-checkbox) {
559
+ height: @form-small-radio-size;
560
+ width: @form-small-radio-size;
561
+ }
562
+
563
+ /*
564
+ * Large
565
+ */
566
+
567
+ .uk-form-large:is(.uk-input, .uk-search-input, .uk-select, .uk-textarea) { font-size: @form-large-font-size; }
568
+
569
+ /* Single-line */
570
+ .uk-form-large:is(.uk-input, .uk-search-input, .uk-select:not([multiple]):not([size])) {
571
+ height: @form-large-height;
572
+ padding-left: @form-large-padding-horizontal;
573
+ padding-right: @form-large-padding-horizontal;
574
+ }
575
+
576
+ /* Multi-line */
577
+ .uk-form-large:is(.uk-select[multiple], .uk-select[size], .uk-textarea) { padding: @form-large-padding-vertical @form-large-padding-horizontal; }
578
+
579
+ /* Any element */
580
+ .uk-form-large:not(select):not(input):not(textarea):not([type="radio"]):not([type="checkbox"]) { line-height: @form-large-line-height; }
581
+
582
+ /* Radio + Checkbox */
583
+ .uk-form-large:is(.uk-radio, .uk-checkbox) {
584
+ height: @form-large-radio-size;
585
+ width: @form-large-radio-size;
586
+ }
587
+
588
+
569
589
  /* Legend
570
590
  ========================================================================== */
571
591