vue3-router-tab 1.1.6 → 1.1.8

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 (2) hide show
  1. package/lib/scss/index.scss +3 -185
  2. package/package.json +1 -1
@@ -7,11 +7,6 @@ $light-bg: #ffffff;
7
7
  $light-text: #1e293b;
8
8
  $light-border: rgba(15, 23, 42, 0.08);
9
9
 
10
- // Dark mode fallbacks
11
- $dark-bg: #0f172a;
12
- $dark-text: #e2e8f0;
13
- $dark-border: rgba(226, 232, 240, 0.12);
14
-
15
10
  $font-size: 14px;
16
11
  $tab-trans: all 0.3s ease-in-out;
17
12
  $hd-height: 40px;
@@ -24,20 +19,6 @@ $close-icon-size: 13px;
24
19
  @return string.unquote("var(#{$name}, #{$fallback})");
25
20
  }
26
21
 
27
- /// Mixin for reduced motion preferences
28
- @mixin reduced-motion {
29
- @media (prefers-reduced-motion: reduce) {
30
- @content;
31
- }
32
- }
33
-
34
- /// Mixin for dark theme styles - works with data-theme="dark"
35
- @mixin dark-theme {
36
- :root[data-theme="dark"] & {
37
- @content;
38
- }
39
- }
40
-
41
22
  .router-tab {
42
23
  $bg: css-var(--router-tab-background, css-var(--theme-background, $light-bg));
43
24
  $fg: css-var(--router-tab-foreground, css-var(--theme-foreground, $light-text));
@@ -54,16 +35,6 @@ $close-icon-size: 13px;
54
35
  background-color: transparent;
55
36
  color: inherit;
56
37
 
57
- // Dark theme default values
58
- @include dark-theme {
59
- --router-tab-background: #{$dark-bg};
60
- --router-tab-foreground: #{$dark-text};
61
- --router-tab-border: #{$dark-border};
62
- --router-tab-tooltip-background: rgba(226, 232, 240, 0.95);
63
- --router-tab-tooltip-foreground: #{$dark-bg};
64
- --router-tab-tooltip-shadow: 0 8px 24px rgba(0, 0, 0, 0.4);
65
- }
66
-
67
38
  &__header {
68
39
  position: relative;
69
40
  z-index: 9;
@@ -72,12 +43,8 @@ $close-icon-size: 13px;
72
43
  box-sizing: border-box;
73
44
  height: $hd-height;
74
45
  border-bottom: 1px solid $border;
75
- background-color: transparent;
46
+ background-color: $header-bg;
76
47
  transition: all 0.2s ease-in-out;
77
-
78
- @include reduced-motion {
79
- transition: none;
80
- }
81
48
  }
82
49
 
83
50
  &__scroll {
@@ -94,7 +61,6 @@ $close-icon-size: 13px;
94
61
  &.is-mobile {
95
62
  overflow-x: auto;
96
63
  overflow-y: hidden;
97
- -webkit-overflow-scrolling: touch;
98
64
  }
99
65
  }
100
66
  }
@@ -112,10 +78,6 @@ $close-icon-size: 13px;
112
78
  opacity: 0;
113
79
  transition: opacity 0.3s ease-in-out;
114
80
 
115
- @include reduced-motion {
116
- transition: none;
117
- }
118
-
119
81
  .router-tab__scroll:hover &,
120
82
  &.is-dragging {
121
83
  opacity: 1;
@@ -130,29 +92,11 @@ $close-icon-size: 13px;
130
92
  border-radius: $h;
131
93
  transition: background-color 0.3s ease-in-out;
132
94
 
133
- @include reduced-motion {
134
- transition: none;
135
- }
136
-
137
95
  &:hover,
138
96
  .router-tab__scrollbar.is-dragging & {
139
97
  background-color: rgba(0, 0, 0, 0.2);
140
98
  }
141
99
  }
142
-
143
- // Dark theme scrollbar
144
- @include dark-theme {
145
- background-color: rgba(255, 255, 255, 0.15);
146
-
147
- .router-tab__scrollbar-thumb {
148
- background-color: rgba(255, 255, 255, 0.2);
149
-
150
- &:hover,
151
- &.is-dragging {
152
- background-color: rgba(255, 255, 255, 0.35);
153
- }
154
- }
155
- }
156
100
  }
157
101
 
158
102
  &__nav {
@@ -181,21 +125,10 @@ $close-icon-size: 13px;
181
125
  user-select: none;
182
126
  background-color: transparent;
183
127
 
184
- @include reduced-motion {
185
- transition: none;
186
- }
187
-
188
128
  &:first-child {
189
129
  border-left: 1px solid $border;
190
130
  }
191
131
 
192
- // Keyboard focus styles
193
- &:focus-visible {
194
- outline: 2px solid $primary;
195
- outline-offset: -2px;
196
- z-index: 1;
197
- }
198
-
199
132
  &.is-contextmenu {
200
133
  color: $primary;
201
134
  }
@@ -203,10 +136,6 @@ $close-icon-size: 13px;
203
136
  &.is-drag-over {
204
137
  background: rgba(0, 0, 0, 0.05);
205
138
  transition: background 0.15s ease;
206
-
207
- @include dark-theme {
208
- background: rgba(255, 255, 255, 0.08);
209
- }
210
139
  }
211
140
 
212
141
  &-title {
@@ -223,17 +152,11 @@ $close-icon-size: 13px;
223
152
  overflow: hidden;
224
153
  white-space: nowrap;
225
154
  text-overflow: ellipsis;
226
- transition: max-width 0.3s ease-in-out;
227
-
228
- @include reduced-motion {
229
- transition: none;
230
- }
231
155
  }
232
156
 
233
157
  &-icon {
234
158
  margin-right: 5px;
235
159
  font-size: 16px;
236
- flex-shrink: 0;
237
160
  }
238
161
 
239
162
  &:hover,
@@ -263,10 +186,7 @@ $close-icon-size: 13px;
263
186
 
264
187
  &.is-active {
265
188
  border-bottom-color: $bg;
266
- // Fallback for browsers without color-mix support
267
- background: rgba(99, 91, 255, 0.12);
268
189
  background: color-mix(in srgb, $primary 12%, $bg 88%);
269
- box-shadow: inset 0 -2px 0 rgba(99, 91, 255, 0.65);
270
190
  box-shadow: inset 0 -2px 0 color-mix(in srgb, $primary 65%, transparent);
271
191
  color: color-mix(in srgb, $primary 80%, $fg 20%);
272
192
 
@@ -306,12 +226,6 @@ $close-icon-size: 13px;
306
226
  opacity: 0;
307
227
  pointer-events: none;
308
228
  transition: opacity 0.2s ease, transform 0.2s ease;
309
- z-index: 10;
310
-
311
- @include reduced-motion {
312
- transition: opacity 0.2s ease;
313
- transform: translate(-50%, 0);
314
- }
315
229
  }
316
230
 
317
231
  &::before {
@@ -326,12 +240,6 @@ $close-icon-size: 13px;
326
240
  opacity: 0;
327
241
  pointer-events: none;
328
242
  transition: opacity 0.2s ease, transform 0.2s ease;
329
- z-index: 9;
330
-
331
- @include reduced-motion {
332
- transition: opacity 0.2s ease;
333
- transform: translate(-50%, 0) rotate(45deg);
334
- }
335
243
  }
336
244
 
337
245
  &:hover::after {
@@ -359,17 +267,6 @@ $close-icon-size: 13px;
359
267
  transition: $tab-trans;
360
268
  background: transparent;
361
269
  border: none;
362
- flex-shrink: 0;
363
-
364
- @include reduced-motion {
365
- transition: none;
366
- }
367
-
368
- // Keyboard focus
369
- &:focus-visible {
370
- outline: 2px solid $primary;
371
- outline-offset: 2px;
372
- }
373
270
 
374
271
  &::before,
375
272
  &::after {
@@ -383,10 +280,6 @@ $close-icon-size: 13px;
383
280
  background-color: currentColor;
384
281
  transition: background-color 0.2s ease-in-out;
385
282
  content: '';
386
-
387
- @include reduced-motion {
388
- transition: none;
389
- }
390
283
  }
391
284
 
392
285
  &::before {
@@ -398,8 +291,6 @@ $close-icon-size: 13px;
398
291
  }
399
292
 
400
293
  &:hover {
401
- // Fallback for browsers without color-mix
402
- background-color: rgba(99, 91, 255, 0.4);
403
294
  background-color: color-mix(in srgb, $primary 40%, #ffffff 60%);
404
295
 
405
296
  &::before,
@@ -407,14 +298,6 @@ $close-icon-size: 13px;
407
298
  background-color: #fff;
408
299
  }
409
300
  }
410
-
411
- // Dark theme close button
412
- @include dark-theme {
413
- &:hover {
414
- background-color: rgba(99, 91, 255, 0.6);
415
- background-color: color-mix(in srgb, $primary 60%, transparent 40%);
416
- }
417
- }
418
301
  }
419
302
  }
420
303
 
@@ -429,11 +312,6 @@ $close-icon-size: 13px;
429
312
  box-shadow: 0 10px 30px rgba(15, 23, 42, 0.15);
430
313
  border-radius: 8px;
431
314
 
432
- // Dark theme context menu
433
- @include dark-theme {
434
- box-shadow: 0 10px 30px rgba(0, 0, 0, 0.5);
435
- }
436
-
437
315
  a,
438
316
  button {
439
317
  display: block;
@@ -448,36 +326,15 @@ $close-icon-size: 13px;
448
326
  font: inherit;
449
327
  transition: background-color 0.2s ease-in-out;
450
328
 
451
- @include reduced-motion {
452
- transition: none;
453
- }
454
-
455
- // Keyboard focus
456
- &:focus-visible {
457
- outline: 2px solid $primary;
458
- outline-offset: -2px;
459
- }
460
-
461
329
  &[aria-disabled='true'] {
462
330
  color: rgba(148, 163, 184, 0.6);
463
331
  pointer-events: none;
464
- cursor: not-allowed;
465
-
466
- @include dark-theme {
467
- color: rgba(226, 232, 240, 0.3);
468
- }
469
332
  }
470
333
 
471
- &:hover:not([aria-disabled='true']),
472
- &:focus-visible:not([aria-disabled='true']) {
473
- // Fallback for browsers without color-mix
474
- background: rgba(99, 91, 255, 0.2);
334
+ &:hover,
335
+ &:focus-visible {
475
336
  background: color-mix(in srgb, $primary 20%, #ffffff 80%);
476
337
  color: $primary;
477
-
478
- @include dark-theme {
479
- background: color-mix(in srgb, $primary 25%, transparent 75%);
480
- }
481
338
  }
482
339
  }
483
340
  }
@@ -493,42 +350,3 @@ $close-icon-size: 13px;
493
350
  .router-tab__item.is-active + .router-tab__item {
494
351
  border-left-color: css-var(--router-tab-border, css-var(--theme-border, $light-border));
495
352
  }
496
-
497
- // Container query support (progressive enhancement)
498
- @supports (container-type: inline-size) {
499
- .router-tab {
500
- container-type: inline-size;
501
- container-name: router-tab;
502
- }
503
-
504
- @container router-tab (max-width: 600px) {
505
- .router-tab__item {
506
- padding: 0 12px;
507
-
508
- &-title {
509
- max-width: var(--router-tab-title-max-width, 80px);
510
- }
511
-
512
- &:hover .router-tab__item-title {
513
- max-width: var(--router-tab-title-hover-max-width, 150px);
514
- }
515
- }
516
- }
517
- }
518
-
519
- // High contrast mode support
520
- @media (prefers-contrast: high) {
521
- .router-tab {
522
- &__item {
523
- border-width: 2px;
524
-
525
- &.is-active {
526
- border-bottom-width: 3px;
527
- }
528
-
529
- &:focus-visible {
530
- outline-width: 3px;
531
- }
532
- }
533
- }
534
- }
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "vue3-router-tab",
3
- "version": "1.1.6",
3
+ "version": "1.1.8",
4
4
  "type": "module",
5
5
  "files": [
6
6
  "dist",