uikit 3.7.6 → 3.8.0

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 (121) hide show
  1. package/CHANGELOG.md +23 -6
  2. package/build/prefix.js +2 -2
  3. package/build/release.js +12 -16
  4. package/build/scope.js +14 -19
  5. package/build/util.js +1 -1
  6. package/dist/css/uikit-core-rtl.css +327 -835
  7. package/dist/css/uikit-core-rtl.min.css +1 -1
  8. package/dist/css/uikit-core.css +327 -835
  9. package/dist/css/uikit-core.min.css +1 -1
  10. package/dist/css/uikit-rtl.css +359 -843
  11. package/dist/css/uikit-rtl.min.css +1 -1
  12. package/dist/css/uikit.css +359 -843
  13. package/dist/css/uikit.min.css +1 -1
  14. package/dist/js/components/countdown.js +1 -1
  15. package/dist/js/components/countdown.min.js +1 -1
  16. package/dist/js/components/filter.js +1 -1
  17. package/dist/js/components/filter.min.js +1 -1
  18. package/dist/js/components/lightbox-panel.js +2 -18
  19. package/dist/js/components/lightbox-panel.min.js +2 -2
  20. package/dist/js/components/lightbox.js +2 -18
  21. package/dist/js/components/lightbox.min.js +2 -2
  22. package/dist/js/components/notification.js +1 -1
  23. package/dist/js/components/notification.min.js +1 -1
  24. package/dist/js/components/parallax.js +1 -1
  25. package/dist/js/components/parallax.min.js +1 -1
  26. package/dist/js/components/slider-parallax.js +1 -1
  27. package/dist/js/components/slider-parallax.min.js +1 -1
  28. package/dist/js/components/slider.js +1 -1
  29. package/dist/js/components/slider.min.js +1 -1
  30. package/dist/js/components/slideshow-parallax.js +1 -1
  31. package/dist/js/components/slideshow-parallax.min.js +1 -1
  32. package/dist/js/components/slideshow.js +1 -1
  33. package/dist/js/components/slideshow.min.js +1 -1
  34. package/dist/js/components/sortable.js +1 -1
  35. package/dist/js/components/sortable.min.js +1 -1
  36. package/dist/js/components/tooltip.js +1 -1
  37. package/dist/js/components/tooltip.min.js +1 -1
  38. package/dist/js/components/upload.js +1 -1
  39. package/dist/js/components/upload.min.js +1 -1
  40. package/dist/js/uikit-core.js +8 -21
  41. package/dist/js/uikit-core.min.js +2 -2
  42. package/dist/js/uikit-icons.js +1 -1
  43. package/dist/js/uikit-icons.min.js +1 -1
  44. package/dist/js/uikit.js +8 -21
  45. package/dist/js/uikit.min.js +2 -2
  46. package/package.json +6 -6
  47. package/src/js/core/sticky.js +5 -2
  48. package/src/js/mixin/modal.js +1 -17
  49. package/src/less/components/accordion.less +3 -6
  50. package/src/less/components/alert.less +2 -3
  51. package/src/less/components/animation.less +69 -216
  52. package/src/less/components/badge.less +2 -5
  53. package/src/less/components/base.less +39 -11
  54. package/src/less/components/breadcrumb.less +3 -5
  55. package/src/less/components/button.less +17 -36
  56. package/src/less/components/close.less +3 -6
  57. package/src/less/components/cover.less +11 -6
  58. package/src/less/components/dotnav.less +3 -6
  59. package/src/less/components/dropdown.less +1 -3
  60. package/src/less/components/icon.less +5 -11
  61. package/src/less/components/iconnav.less +3 -6
  62. package/src/less/components/lightbox.less +11 -7
  63. package/src/less/components/link.less +6 -14
  64. package/src/less/components/marker.less +3 -6
  65. package/src/less/components/nav.less +10 -24
  66. package/src/less/components/navbar.less +6 -15
  67. package/src/less/components/pagination.less +3 -5
  68. package/src/less/components/position.less +45 -82
  69. package/src/less/components/search.less +3 -11
  70. package/src/less/components/slidenav.less +3 -6
  71. package/src/less/components/slider.less +0 -4
  72. package/src/less/components/slideshow.less +0 -4
  73. package/src/less/components/subnav.less +6 -11
  74. package/src/less/components/tab.less +3 -5
  75. package/src/less/components/thumbnav.less +3 -6
  76. package/src/less/components/totop.less +3 -6
  77. package/src/less/components/transition.less +48 -40
  78. package/src/less/components/utility.less +3 -6
  79. package/src/less/components/visibility.less +16 -45
  80. package/src/less/theme/button.less +0 -3
  81. package/src/less/theme/form.less +1 -1
  82. package/src/less/theme/table.less +9 -1
  83. package/src/scss/components/accordion.scss +2 -4
  84. package/src/scss/components/alert.scss +2 -3
  85. package/src/scss/components/animation.scss +69 -216
  86. package/src/scss/components/badge.scss +1 -3
  87. package/src/scss/components/base.scss +31 -9
  88. package/src/scss/components/breadcrumb.scss +2 -3
  89. package/src/scss/components/button.scss +12 -25
  90. package/src/scss/components/close.scss +2 -4
  91. package/src/scss/components/cover.scss +11 -6
  92. package/src/scss/components/dotnav.scss +2 -4
  93. package/src/scss/components/dropdown.scss +1 -3
  94. package/src/scss/components/icon.scss +3 -7
  95. package/src/scss/components/iconnav.scss +2 -4
  96. package/src/scss/components/lightbox.scss +11 -7
  97. package/src/scss/components/link.scss +3 -8
  98. package/src/scss/components/marker.scss +2 -4
  99. package/src/scss/components/nav.scss +6 -16
  100. package/src/scss/components/navbar.scss +6 -13
  101. package/src/scss/components/pagination.scss +2 -3
  102. package/src/scss/components/position.scss +45 -82
  103. package/src/scss/components/search.scss +2 -9
  104. package/src/scss/components/slidenav.scss +2 -4
  105. package/src/scss/components/slider.scss +0 -4
  106. package/src/scss/components/slideshow.scss +0 -4
  107. package/src/scss/components/subnav.scss +4 -7
  108. package/src/scss/components/tab.scss +2 -3
  109. package/src/scss/components/thumbnav.scss +2 -4
  110. package/src/scss/components/totop.scss +2 -4
  111. package/src/scss/components/transition.scss +48 -40
  112. package/src/scss/components/utility.scss +2 -4
  113. package/src/scss/components/visibility.scss +16 -45
  114. package/src/scss/mixins-theme.scss +42 -101
  115. package/src/scss/mixins.scss +38 -66
  116. package/src/scss/theme/button.scss +0 -2
  117. package/src/scss/theme/form.scss +1 -1
  118. package/src/scss/theme/table.scss +2 -1
  119. package/src/scss/variables-theme.scss +4 -1
  120. package/src/scss/variables.scss +3 -0
  121. package/tests/transition.html +4 -10
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.7.6",
5
+ "version": "3.8.0",
6
6
  "main": "dist/js/uikit.js",
7
7
  "style": "dist/css/uikit.css",
8
8
  "sideEffects": [
@@ -36,18 +36,18 @@
36
36
  "devDependencies": {
37
37
  "@rollup/plugin-alias": "^3.1.5",
38
38
  "@rollup/plugin-buble": "^0.21.3",
39
- "@rollup/plugin-replace": "^2.3.4",
39
+ "@rollup/plugin-replace": "^2.4.2",
40
40
  "archiver": "5.3.0",
41
41
  "camelcase": "^6.2.0",
42
42
  "clean-css": "^5.1.5",
43
- "dateformat": "^4.5.1",
44
- "eslint": "7.32.0",
43
+ "dateformat": "^4.6.3",
44
+ "eslint": "8.0.1",
45
45
  "glob": "^7.2.0",
46
- "inquirer": "8.1.5",
46
+ "inquirer": "8.2.0",
47
47
  "less": "^2.7.2",
48
48
  "minimist": "^1.2.5",
49
49
  "npm-watch": "github:dasdeck/npm-watch#46a8a36c61cfd998ed53d27f62eaf79e11c395b4",
50
- "postcss": "8.3.7",
50
+ "postcss": "8.3.9",
51
51
  "rollup": "^2.57.0",
52
52
  "rollup-plugin-html": "^0.2.1",
53
53
  "rtlcss": "^3.3.0",
@@ -148,6 +148,7 @@ export default {
148
148
 
149
149
  this.topOffset = offset(this.isFixed ? this.placeholder : this.$el).top;
150
150
  this.bottomOffset = this.topOffset + height;
151
+ this.offsetParentTop = offset(this.$el.offsetParent).top;
151
152
 
152
153
  const bottom = parseProp('bottom', this);
153
154
 
@@ -285,13 +286,15 @@ export default {
285
286
 
286
287
  const active = this.top !== 0 || this.scroll > this.top;
287
288
  let top = Math.max(0, this.offset);
289
+ let position = 'fixed';
288
290
 
289
291
  if (isNumeric(this.bottom) && this.scroll > this.bottom - this.offset) {
290
- top = this.bottom - this.scroll;
292
+ top = this.bottom - this.offsetParentTop;
293
+ position = 'absolute';
291
294
  }
292
295
 
293
296
  css(this.$el, {
294
- position: 'fixed',
297
+ position,
295
298
  top: `${top}px`,
296
299
  width: this.width
297
300
  });
@@ -78,7 +78,6 @@ export default {
78
78
 
79
79
  e.preventDefault();
80
80
 
81
- this.target = toggle.$el;
82
81
  if (this.isToggled() === includes(active, this)) {
83
82
  this.toggle();
84
83
  }
@@ -161,7 +160,7 @@ export default {
161
160
 
162
161
  handler() {
163
162
  if (!isFocusable(this.$el)) {
164
- attr(this.$el, 'tabindex', '0');
163
+ attr(this.$el, 'tabindex', '-1');
165
164
  }
166
165
 
167
166
  if (!$(':focus', this.$el)) {
@@ -170,21 +169,6 @@ export default {
170
169
  }
171
170
  },
172
171
 
173
- {
174
-
175
- name: 'hide',
176
-
177
- self: true,
178
-
179
- handler() {
180
- if (isFocusable(this.target)) {
181
- this.target.focus();
182
- this.target = null;
183
- }
184
- }
185
-
186
- },
187
-
188
172
  {
189
173
 
190
174
  name: 'hidden',
@@ -55,12 +55,10 @@
55
55
  .hook-accordion-title;
56
56
  }
57
57
 
58
- /* Hover + Focus */
59
- .uk-accordion-title:hover,
60
- .uk-accordion-title:focus {
58
+ /* Hover */
59
+ .uk-accordion-title:hover {
61
60
  color: @accordion-title-hover-color;
62
61
  text-decoration: none;
63
- outline: none;
64
62
  .hook-accordion-title-hover;
65
63
  }
66
64
 
@@ -111,8 +109,7 @@
111
109
  .hook-inverse-accordion-title;
112
110
  }
113
111
 
114
- .uk-accordion-title:hover,
115
- .uk-accordion-title:focus {
112
+ .uk-accordion-title:hover {
116
113
  color: @inverse-accordion-title-hover-color;
117
114
  .hook-inverse-accordion-title-hover;
118
115
  }
@@ -79,11 +79,10 @@
79
79
  .uk-alert-close:first-child + * { margin-top: 0; }
80
80
 
81
81
  /*
82
- * Hover + Focus
82
+ * Hover
83
83
  */
84
84
 
85
- .uk-alert-close:hover,
86
- .uk-alert-close:focus {
85
+ .uk-alert-close:hover {
87
86
  .hook-alert-close-hover;
88
87
  }
89
88
 
@@ -40,11 +40,7 @@
40
40
  Component: Animation
41
41
  ========================================================================== */
42
42
 
43
- [class*='uk-animation-'] {
44
- animation-duration: @animation-duration;
45
- animation-timing-function: ease-out;
46
- animation-fill-mode: both;
47
- }
43
+ [class*='uk-animation-'] { animation: @animation-duration ease-out both; }
48
44
 
49
45
 
50
46
  /* Animations
@@ -64,42 +60,42 @@
64
60
  * Scale
65
61
  */
66
62
 
67
- .uk-animation-scale-up { animation-name: uk-fade-scale-02; }
68
- .uk-animation-scale-down { animation-name: uk-fade-scale-18; }
63
+ .uk-animation-scale-up { animation-name: uk-fade, uk-scale-up; }
64
+ .uk-animation-scale-down { animation-name: uk-fade, uk-scale-down; }
69
65
 
70
66
  /*
71
67
  * Slide
72
68
  */
73
69
 
74
- .uk-animation-slide-top { animation-name: uk-fade-top; }
75
- .uk-animation-slide-bottom { animation-name: uk-fade-bottom; }
76
- .uk-animation-slide-left { animation-name: uk-fade-left; }
77
- .uk-animation-slide-right { animation-name: uk-fade-right; }
70
+ .uk-animation-slide-top { animation-name: uk-fade, uk-slide-top; }
71
+ .uk-animation-slide-bottom { animation-name: uk-fade, uk-slide-bottom; }
72
+ .uk-animation-slide-left { animation-name: uk-fade, uk-slide-left; }
73
+ .uk-animation-slide-right { animation-name: uk-fade, uk-slide-right; }
78
74
 
79
75
  /*
80
76
  * Slide Small
81
77
  */
82
78
 
83
- .uk-animation-slide-top-small { animation-name: uk-fade-top-small; }
84
- .uk-animation-slide-bottom-small { animation-name: uk-fade-bottom-small; }
85
- .uk-animation-slide-left-small { animation-name: uk-fade-left-small; }
86
- .uk-animation-slide-right-small { animation-name: uk-fade-right-small; }
79
+ .uk-animation-slide-top-small { animation-name: uk-fade, uk-slide-top-small; }
80
+ .uk-animation-slide-bottom-small { animation-name: uk-fade, uk-slide-bottom-small; }
81
+ .uk-animation-slide-left-small { animation-name: uk-fade, uk-slide-left-small; }
82
+ .uk-animation-slide-right-small { animation-name: uk-fade, uk-slide-right-small; }
87
83
 
88
84
  /*
89
85
  * Slide Medium
90
86
  */
91
-
92
- .uk-animation-slide-top-medium { animation-name: uk-fade-top-medium; }
93
- .uk-animation-slide-bottom-medium { animation-name: uk-fade-bottom-medium; }
94
- .uk-animation-slide-left-medium { animation-name: uk-fade-left-medium; }
95
- .uk-animation-slide-right-medium { animation-name: uk-fade-right-medium; }
87
+
88
+ .uk-animation-slide-top-medium { animation-name: uk-fade, uk-slide-top-medium; }
89
+ .uk-animation-slide-bottom-medium { animation-name: uk-fade, uk-slide-bottom-medium; }
90
+ .uk-animation-slide-left-medium { animation-name: uk-fade, uk-slide-left-medium; }
91
+ .uk-animation-slide-right-medium { animation-name: uk-fade, uk-slide-right-medium; }
96
92
 
97
93
  /*
98
94
  * Kenburns
99
95
  */
100
96
 
101
97
  .uk-animation-kenburns {
102
- animation-name: uk-scale-kenburns;
98
+ animation-name: uk-kenburns;
103
99
  animation-duration: @animation-kenburns-duration;
104
100
  }
105
101
 
@@ -119,15 +115,15 @@
119
115
 
120
116
  .uk-animation-stroke {
121
117
  animation-name: uk-stroke;
122
- stroke-dasharray: var(--uk-animation-stroke);
123
118
  animation-duration: @animation-stroke-duration;
119
+ stroke-dasharray: var(--uk-animation-stroke);
124
120
  }
125
121
 
126
122
 
127
123
  /* Direction modifier
128
124
  ========================================================================== */
129
125
 
130
- .uk-animation-reverse {
126
+ .uk-animation-reverse {
131
127
  animation-direction: reverse;
132
128
  animation-timing-function: ease-in;
133
129
  }
@@ -136,33 +132,14 @@
136
132
  /* Duration modifier
137
133
  ========================================================================== */
138
134
 
139
- .uk-animation-fast { animation-duration: @animation-fast-duration; }
135
+ .uk-animation-fast { animation-duration: @animation-fast-duration; }
140
136
 
141
137
 
142
- /* Toggle (Hover + Focus)
143
- ========================================================================== */
144
-
145
- /*
146
- * The toggle is triggered on touch devices using `:focus` and tabindex
147
- */
138
+ /* Toggle animation based on the State of the Parent Element
139
+ ========================================================================== */
148
140
 
149
141
  .uk-animation-toggle:not(:hover):not(:focus) [class*='uk-animation-'] { animation-name: none; }
150
142
 
151
- /*
152
- * 1. Prevent tab highlighting on iOS.
153
- */
154
-
155
- .uk-animation-toggle {
156
- /* 1 */
157
- -webkit-tap-highlight-color: transparent;
158
- }
159
-
160
- /*
161
- * Remove outline for `tabindex`
162
- */
163
-
164
- .uk-animation-toggle:focus { outline: none; }
165
-
166
143
 
167
144
  /* Keyframes used by animation classes
168
145
  ========================================================================== */
@@ -177,220 +154,96 @@
177
154
  }
178
155
 
179
156
  /*
180
- * Slide Top
157
+ * Scale
181
158
  */
182
159
 
183
- @keyframes uk-fade-top {
184
- 0% {
185
- opacity: 0;
186
- transform: translateY(-100%);
187
- }
188
- 100% {
189
- opacity: 1;
190
- transform: translateY(0);
191
- }
160
+ @keyframes uk-scale-up {
161
+ 0% { transform: scale(0.9); }
162
+ 100% { transform: scale(1); }
192
163
  }
193
164
 
194
- /*
195
- * Slide Bottom
196
- */
197
-
198
- @keyframes uk-fade-bottom {
199
- 0% {
200
- opacity: 0;
201
- transform: translateY(100%);
202
- }
203
- 100% {
204
- opacity: 1;
205
- transform: translateY(0);
206
- }
165
+ @keyframes uk-scale-down {
166
+ 0% { transform: scale(1.1); }
167
+ 100% { transform: scale(1); }
207
168
  }
208
169
 
209
170
  /*
210
- * Slide Left
171
+ * Slide
211
172
  */
212
173
 
213
- @keyframes uk-fade-left {
214
- 0% {
215
- opacity: 0;
216
- transform: translateX(-100%);
217
- }
218
- 100% {
219
- opacity: 1;
220
- transform: translateX(0);
221
- }
174
+ @keyframes uk-slide-top {
175
+ 0% { transform: translateY(-100%); }
176
+ 100% { transform: translateY(0); }
222
177
  }
223
178
 
224
- /*
225
- * Slide Right
226
- */
227
-
228
- @keyframes uk-fade-right {
229
- 0% {
230
- opacity: 0;
231
- transform: translateX(100%);
232
- }
233
- 100% {
234
- opacity: 1;
235
- transform: translateX(0);
236
- }
179
+ @keyframes uk-slide-bottom {
180
+ 0% { transform: translateY(100%); }
181
+ 100% { transform: translateY(0); }
237
182
  }
238
183
 
239
- /*
240
- * Slide Top Small
241
- */
242
-
243
- @keyframes uk-fade-top-small {
244
- 0% {
245
- opacity: 0;
246
- transform: translateY(-@animation-slide-small-translate);
247
- }
248
- 100% {
249
- opacity: 1;
250
- transform: translateY(0);
251
- }
184
+ @keyframes uk-slide-left {
185
+ 0% { transform: translateX(-100%); }
186
+ 100% { transform: translateX(0); }
252
187
  }
253
188
 
254
- /*
255
- * Slide Bottom Small
256
- */
257
-
258
- @keyframes uk-fade-bottom-small {
259
- 0% {
260
- opacity: 0;
261
- transform: translateY(@animation-slide-small-translate);
262
- }
263
- 100% {
264
- opacity: 1;
265
- transform: translateY(0);
266
- }
189
+ @keyframes uk-slide-right {
190
+ 0% { transform: translateX(100%); }
191
+ 100% { transform: translateX(0); }
267
192
  }
268
193
 
269
194
  /*
270
- * Slide Left Small
195
+ * Slide Small
271
196
  */
272
197
 
273
- @keyframes uk-fade-left-small {
274
- 0% {
275
- opacity: 0;
276
- transform: translateX(-@animation-slide-small-translate);
277
- }
278
- 100% {
279
- opacity: 1;
280
- transform: translateX(0);
281
- }
198
+ @keyframes uk-slide-top-small {
199
+ 0% { transform: translateY(-@animation-slide-small-translate); }
200
+ 100% { transform: translateY(0); }
282
201
  }
283
202
 
284
- /*
285
- * Slide Right Small
286
- */
287
-
288
- @keyframes uk-fade-right-small {
289
- 0% {
290
- opacity: 0;
291
- transform: translateX(@animation-slide-small-translate);
292
- }
293
- 100% {
294
- opacity: 1;
295
- transform: translateX(0);
296
- }
203
+ @keyframes uk-slide-bottom-small {
204
+ 0% { transform: translateY(@animation-slide-small-translate); }
205
+ 100% { transform: translateY(0); }
297
206
  }
298
207
 
299
- /*
300
- * Slide Top Medium
301
- */
302
-
303
- @keyframes uk-fade-top-medium {
304
- 0% {
305
- opacity: 0;
306
- transform: translateY(-@animation-slide-medium-translate);
307
- }
308
- 100% {
309
- opacity: 1;
310
- transform: translateY(0);
311
- }
208
+ @keyframes uk-slide-left-small {
209
+ 0% { transform: translateX(-@animation-slide-small-translate); }
210
+ 100% { transform: translateX(0); }
312
211
  }
313
212
 
314
- /*
315
- * Slide Bottom Medium
316
- */
317
-
318
- @keyframes uk-fade-bottom-medium {
319
- 0% {
320
- opacity: 0;
321
- transform: translateY(@animation-slide-medium-translate);
322
- }
323
- 100% {
324
- opacity: 1;
325
- transform: translateY(0);
326
- }
213
+ @keyframes uk-slide-right-small {
214
+ 0% { transform: translateX(@animation-slide-small-translate); }
215
+ 100% { transform: translateX(0); }
327
216
  }
328
217
 
329
218
  /*
330
- * Slide Left Medium
219
+ * Slide Medium
331
220
  */
332
221
 
333
- @keyframes uk-fade-left-medium {
334
- 0% {
335
- opacity: 0;
336
- transform: translateX(-@animation-slide-medium-translate);
337
- }
338
- 100% {
339
- opacity: 1;
340
- transform: translateX(0);
341
- }
222
+ @keyframes uk-slide-top-medium {
223
+ 0% { transform: translateY(-@animation-slide-medium-translate); }
224
+ 100% { transform: translateY(0); }
342
225
  }
343
226
 
344
- /*
345
- * Slide Right Medium
346
- */
347
-
348
- @keyframes uk-fade-right-medium {
349
- 0% {
350
- opacity: 0;
351
- transform: translateX(@animation-slide-medium-translate);
352
- }
353
- 100% {
354
- opacity: 1;
355
- transform: translateX(0);
356
- }
227
+ @keyframes uk-slide-bottom-medium {
228
+ 0% { transform: translateY(@animation-slide-medium-translate); }
229
+ 100% { transform: translateY(0); }
357
230
  }
358
231
 
359
- /*
360
- * Scale Up
361
- */
362
-
363
- @keyframes uk-fade-scale-02 {
364
- 0% {
365
- opacity: 0;
366
- transform: scale(0.2);
367
- }
368
- 100% {
369
- opacity: 1;
370
- transform: scale(1);
371
- }
232
+ @keyframes uk-slide-left-medium {
233
+ 0% { transform: translateX(-@animation-slide-medium-translate); }
234
+ 100% { transform: translateX(0); }
372
235
  }
373
236
 
374
- /*
375
- * Scale Down
376
- */
377
-
378
- @keyframes uk-fade-scale-18 {
379
- 0% {
380
- opacity: 0;
381
- transform: scale(1.8);
382
- }
383
- 100% {
384
- opacity: 1;
385
- transform: scale(1);
386
- }
237
+ @keyframes uk-slide-right-medium {
238
+ 0% { transform: translateX(@animation-slide-medium-translate); }
239
+ 100% { transform: translateX(0); }
387
240
  }
388
241
 
389
242
  /*
390
243
  * Kenburns
391
244
  */
392
245
 
393
- @keyframes uk-scale-kenburns {
246
+ @keyframes uk-kenburns {
394
247
  0% { transform: scale(1); }
395
248
  100% { transform: scale(1.2); }
396
249
  }
@@ -50,10 +50,8 @@
50
50
  * Required for `a`
51
51
  */
52
52
 
53
- .uk-badge:hover,
54
- .uk-badge:focus {
53
+ .uk-badge:hover {
55
54
  text-decoration: none;
56
- outline: none;
57
55
  .hook-badge-hover;
58
56
  }
59
57
 
@@ -82,8 +80,7 @@
82
80
  .hook-inverse-badge;
83
81
  }
84
82
 
85
- .uk-badge:hover,
86
- .uk-badge:focus {
83
+ .uk-badge:hover {
87
84
  .hook-inverse-badge-hover;
88
85
  }
89
86
 
@@ -76,6 +76,8 @@
76
76
  @base-pre-font-family: @base-code-font-family;
77
77
  @base-pre-color: @global-color;
78
78
 
79
+ @base-focus-outline: @global-emphasis-color;
80
+
79
81
  @base-selection-background: #39f;
80
82
  @base-selection-color: @global-inverse-color;
81
83
 
@@ -115,13 +117,6 @@ body { margin: 0; }
115
117
  /* Links
116
118
  ========================================================================== */
117
119
 
118
- /*
119
- * Remove the outline on focused links when they are also active or hovered
120
- */
121
-
122
- a:active,
123
- a:hover { outline: none; }
124
-
125
120
  /*
126
121
  * Style
127
122
  */
@@ -136,8 +131,7 @@ a,
136
131
 
137
132
  a:hover,
138
133
  .uk-link:hover,
139
- .uk-link-toggle:hover .uk-link,
140
- .uk-link-toggle:focus .uk-link {
134
+ .uk-link-toggle:hover .uk-link {
141
135
  color: @base-link-hover-color;
142
136
  text-decoration: @base-link-hover-text-decoration;
143
137
  .hook-base-link-hover;
@@ -522,6 +516,33 @@ pre {
522
516
  pre code { font-family: @base-pre-font-family; }
523
517
 
524
518
 
519
+ /* Focus
520
+ ========================================================================== */
521
+
522
+ /*
523
+ * Safari doesn't support `:focus-visible` yet. It also doesn't set focus if clicking a button or anchor.
524
+ * 1. Fallback: Remove `:focus` for a negative tabindexes.
525
+ * 2. Fallback: Set `:focus` style but not for negative tabindexes.
526
+ * 3. Fallback: Remove `:focus` style for browsers which support `:focus-visible`.
527
+ * 4. Set `:focus-visible` style for browsers which support it.
528
+ */
529
+
530
+ /* 1 */
531
+ :focus { outline: none; }
532
+
533
+ /* 2 */
534
+ :focus:not([tabindex^='-']) {
535
+ outline: 2px dotted @base-focus-outline;
536
+ outline-offset: 1px;
537
+ }
538
+
539
+ /* 3 */
540
+ :focus:not(:focus-visible) { outline: none; }
541
+
542
+ /* 4 */
543
+ :focus-visible { outline: 2px dotted @base-focus-outline; }
544
+
545
+
525
546
  /* Selection pseudo-element
526
547
  ========================================================================== */
527
548
 
@@ -610,6 +631,7 @@ template { display: none; }
610
631
  @inverse-base-em-color: @inverse-global-emphasis-color;
611
632
  @inverse-base-heading-color: @inverse-global-emphasis-color;
612
633
  @inverse-base-hr-border: @inverse-global-border;
634
+ @inverse-base-focus-outline: @inverse-global-emphasis-color;
613
635
 
614
636
  .hook-inverse() {
615
637
 
@@ -630,8 +652,7 @@ template { display: none; }
630
652
 
631
653
  a:hover,
632
654
  .uk-link:hover,
633
- .uk-link-toggle:hover .uk-link,
634
- .uk-link-toggle:focus .uk-link {
655
+ .uk-link-toggle:hover .uk-link {
635
656
  color: @inverse-base-link-hover-color;
636
657
  .hook-inverse-base-link-hover;
637
658
  }
@@ -717,6 +738,13 @@ template { display: none; }
717
738
  .hook-inverse-base-hr;
718
739
  }
719
740
 
741
+ //
742
+ // Focus
743
+ //
744
+
745
+ :focus { outline-color: @inverse-base-focus-outline; }
746
+ :focus-visible { outline-color: @inverse-base-focus-outline; }
747
+
720
748
  }
721
749
 
722
750
  .hook-inverse-base-link() {}
@@ -53,9 +53,8 @@
53
53
  .hook-breadcrumb-item;
54
54
  }
55
55
 
56
- /* Hover + Focus */
57
- .uk-breadcrumb > * > :hover,
58
- .uk-breadcrumb > * > :focus {
56
+ /* Hover */
57
+ .uk-breadcrumb > * > :hover {
59
58
  color: @breadcrumb-item-hover-color;
60
59
  text-decoration: @breadcrumb-item-hover-text-decoration;
61
60
  .hook-breadcrumb-item-hover;
@@ -121,8 +120,7 @@
121
120
  .hook-inverse-breadcrumb-item;
122
121
  }
123
122
 
124
- .uk-breadcrumb > * > :hover,
125
- .uk-breadcrumb > * > :focus {
123
+ .uk-breadcrumb > * > :hover {
126
124
  color: @inverse-breadcrumb-item-hover-color;
127
125
  .hook-inverse-breadcrumb-item-hover;
128
126
  }