vue3-router-tab 1.1.5 → 1.1.7

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 +61 -89
  2. package/package.json +1 -1
@@ -1,19 +1,19 @@
1
1
  @use "sass:math";
2
2
  @use "sass:string";
3
3
 
4
- // Fallback palette (overridden by CSS vars when present)
4
+ // Fallback palette (overridden by Vuetify CSS vars)
5
5
  $primary-fallback: #635bff;
6
6
  $light-bg: #ffffff;
7
7
  $light-text: #1e293b;
8
8
  $light-border: rgba(15, 23, 42, 0.08);
9
9
 
10
10
  // Dark mode fallbacks
11
- $dark-bg: #0f172a;
11
+ $dark-bg: #1e1e1e;
12
12
  $dark-text: #e2e8f0;
13
13
  $dark-border: rgba(226, 232, 240, 0.12);
14
14
 
15
15
  $font-size: 14px;
16
- $tab-trans: all 0.3s ease-in-out;
16
+ $tab-trans: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
17
17
  $hd-height: 40px;
18
18
  $tab-padding: 20px;
19
19
  $close-icon-margin: 4px;
@@ -39,14 +39,15 @@ $close-icon-size: 13px;
39
39
  }
40
40
 
41
41
  .router-tab {
42
- $bg: css-var(--router-tab-background, css-var(--theme-background, $light-bg));
43
- $fg: css-var(--router-tab-foreground, css-var(--theme-foreground, $light-text));
44
- $border: css-var(--router-tab-border, css-var(--theme-border, $light-border));
45
- $primary: css-var(--router-tab-primary, css-var(--theme-primary, $primary-fallback));
42
+ // Use Vuetify theme colors with fallbacks
43
+ $bg: css-var(--router-tab-background, css-var(--v-theme-surface, css-var(--theme-background, $light-bg)));
44
+ $fg: css-var(--router-tab-foreground, css-var(--v-theme-on-surface, css-var(--theme-foreground, $light-text)));
45
+ $border: css-var(--router-tab-border, css-var(--v-border-color, css-var(--theme-border, $light-border)));
46
+ $primary: css-var(--router-tab-primary, css-var(--v-theme-primary, css-var(--theme-primary, $primary-fallback)));
46
47
  $header-bg: css-var(--router-tab-header-bg, $bg);
47
- $tooltip-bg: css-var(--router-tab-tooltip-background, rgba(15, 23, 42, 0.88));
48
- $tooltip-fg: css-var(--router-tab-tooltip-foreground, #ffffff);
49
- $tooltip-shadow: css-var(--router-tab-tooltip-shadow, 0 8px 24px rgba(15, 23, 42, 0.18));
48
+ $tooltip-bg: css-var(--router-tab-tooltip-background, rgba(var(--v-theme-on-surface), 0.9));
49
+ $tooltip-fg: css-var(--router-tab-tooltip-foreground, css-var(--v-theme-surface, #ffffff));
50
+ $tooltip-shadow: css-var(--router-tab-tooltip-shadow, 0 8px 24px rgba(0, 0, 0, 0.18));
50
51
 
51
52
  display: flex;
52
53
  flex-direction: column;
@@ -56,12 +57,7 @@ $close-icon-size: 13px;
56
57
 
57
58
  // Dark theme default values
58
59
  @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);
60
+ --router-tab-tooltip-shadow: 0 8px 24px rgba(0, 0, 0, 0.5);
65
61
  }
66
62
 
67
63
  &__header {
@@ -73,7 +69,8 @@ $close-icon-size: 13px;
73
69
  height: $hd-height;
74
70
  border-bottom: 1px solid $border;
75
71
  background-color: $header-bg;
76
- transition: all 0.2s ease-in-out;
72
+ transition: border-color 0.2s cubic-bezier(0.4, 0, 0.2, 1),
73
+ background-color 0.2s cubic-bezier(0.4, 0, 0.2, 1);
77
74
 
78
75
  @include reduced-motion {
79
76
  transition: none;
@@ -107,10 +104,10 @@ $close-icon-size: 13px;
107
104
  bottom: 0;
108
105
  left: 0;
109
106
  height: $h;
110
- background-color: rgba(0, 0, 0, 0.1);
107
+ background-color: rgba(var(--v-theme-on-surface, 0, 0, 0), 0.1);
111
108
  border-radius: $h;
112
109
  opacity: 0;
113
- transition: opacity 0.3s ease-in-out;
110
+ transition: opacity 0.3s cubic-bezier(0.4, 0, 0.2, 1);
114
111
 
115
112
  @include reduced-motion {
116
113
  transition: none;
@@ -126,9 +123,9 @@ $close-icon-size: 13px;
126
123
  top: 0;
127
124
  left: 0;
128
125
  height: 100%;
129
- background-color: rgba(0, 0, 0, 0.1);
126
+ background-color: rgba(var(--v-theme-on-surface, 0, 0, 0), 0.15);
130
127
  border-radius: $h;
131
- transition: background-color 0.3s ease-in-out;
128
+ transition: background-color 0.3s cubic-bezier(0.4, 0, 0.2, 1);
132
129
 
133
130
  @include reduced-motion {
134
131
  transition: none;
@@ -136,21 +133,7 @@ $close-icon-size: 13px;
136
133
 
137
134
  &:hover,
138
135
  .router-tab__scrollbar.is-dragging & {
139
- background-color: rgba(0, 0, 0, 0.2);
140
- }
141
- }
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
- }
136
+ background-color: rgba(var(--v-theme-on-surface, 0, 0, 0), 0.25);
154
137
  }
155
138
  }
156
139
  }
@@ -189,7 +172,7 @@ $close-icon-size: 13px;
189
172
  border-left: 1px solid $border;
190
173
  }
191
174
 
192
- // Keyboard focus styles
175
+ // Keyboard focus styles using Vuetify primary color
193
176
  &:focus-visible {
194
177
  outline: 2px solid $primary;
195
178
  outline-offset: -2px;
@@ -201,12 +184,8 @@ $close-icon-size: 13px;
201
184
  }
202
185
 
203
186
  &.is-drag-over {
204
- background: rgba(0, 0, 0, 0.05);
205
- transition: background 0.15s ease;
206
-
207
- @include dark-theme {
208
- background: rgba(255, 255, 255, 0.08);
209
- }
187
+ background: rgba(var(--v-theme-on-surface, 0, 0, 0), 0.05);
188
+ transition: background 0.15s cubic-bezier(0.4, 0, 0.2, 1);
210
189
  }
211
190
 
212
191
  &-title {
@@ -223,7 +202,7 @@ $close-icon-size: 13px;
223
202
  overflow: hidden;
224
203
  white-space: nowrap;
225
204
  text-overflow: ellipsis;
226
- transition: max-width 0.3s ease-in-out;
205
+ transition: max-width 0.3s cubic-bezier(0.4, 0, 0.2, 1);
227
206
 
228
207
  @include reduced-motion {
229
208
  transition: none;
@@ -263,12 +242,15 @@ $close-icon-size: 13px;
263
242
 
264
243
  &.is-active {
265
244
  border-bottom-color: $bg;
266
- // Fallback for browsers without color-mix support
267
- background: rgba(99, 91, 255, 0.12);
268
- background: color-mix(in srgb, $primary 12%, $bg 88%);
269
- box-shadow: inset 0 -2px 0 rgba(99, 91, 255, 0.65);
270
- box-shadow: inset 0 -2px 0 color-mix(in srgb, $primary 65%, transparent);
271
- color: color-mix(in srgb, $primary 80%, $fg 20%);
245
+ // Use rgba with Vuetify primary color variable
246
+ background: rgba(var(--v-theme-primary, 99, 91, 255), 0.08);
247
+ box-shadow: inset 0 -2px 0 rgba(var(--v-theme-primary, 99, 91, 255), 0.5);
248
+
249
+ // Fallback for browsers with color-mix support
250
+ @supports (background: color-mix(in srgb, red 50%, blue)) {
251
+ background: color-mix(in srgb, $primary 8%, $bg 92%);
252
+ box-shadow: inset 0 -2px 0 color-mix(in srgb, $primary 50%, transparent);
253
+ }
272
254
 
273
255
  &::after {
274
256
  content: '';
@@ -279,7 +261,7 @@ $close-icon-size: 13px;
279
261
  height: 2px;
280
262
  border-radius: 999px;
281
263
  background: $primary;
282
- opacity: 0.6;
264
+ opacity: 0.7;
283
265
  pointer-events: none;
284
266
  }
285
267
  }
@@ -292,12 +274,12 @@ $close-icon-size: 13px;
292
274
  bottom: calc(100% + 8px);
293
275
  display: inline-block;
294
276
  max-width: 320px;
295
- padding: 4px 10px;
277
+ padding: 6px 12px;
296
278
  border-radius: 6px;
297
279
  background: $tooltip-bg;
298
280
  color: $tooltip-fg;
299
281
  font-size: 12px;
300
- line-height: 1.3;
282
+ line-height: 1.4;
301
283
  text-align: center;
302
284
  white-space: normal;
303
285
  word-break: break-word;
@@ -305,11 +287,12 @@ $close-icon-size: 13px;
305
287
  box-shadow: $tooltip-shadow;
306
288
  opacity: 0;
307
289
  pointer-events: none;
308
- transition: opacity 0.2s ease, transform 0.2s ease;
290
+ transition: opacity 0.2s cubic-bezier(0.4, 0, 0.2, 1),
291
+ transform 0.2s cubic-bezier(0.4, 0, 0.2, 1);
309
292
  z-index: 10;
310
293
 
311
294
  @include reduced-motion {
312
- transition: opacity 0.2s ease;
295
+ transition: opacity 0.2s cubic-bezier(0.4, 0, 0.2, 1);
313
296
  transform: translate(-50%, 0);
314
297
  }
315
298
  }
@@ -325,11 +308,12 @@ $close-icon-size: 13px;
325
308
  transform: translate(-50%, 6px) rotate(45deg);
326
309
  opacity: 0;
327
310
  pointer-events: none;
328
- transition: opacity 0.2s ease, transform 0.2s ease;
311
+ transition: opacity 0.2s cubic-bezier(0.4, 0, 0.2, 1),
312
+ transform 0.2s cubic-bezier(0.4, 0, 0.2, 1);
329
313
  z-index: 9;
330
314
 
331
315
  @include reduced-motion {
332
- transition: opacity 0.2s ease;
316
+ transition: opacity 0.2s cubic-bezier(0.4, 0, 0.2, 1);
333
317
  transform: translate(-50%, 0) rotate(45deg);
334
318
  }
335
319
  }
@@ -381,7 +365,7 @@ $close-icon-size: 13px;
381
365
  height: 1px;
382
366
  margin-left: math.div(-$inner, 2);
383
367
  background-color: currentColor;
384
- transition: background-color 0.2s ease-in-out;
368
+ transition: background-color 0.2s cubic-bezier(0.4, 0, 0.2, 1);
385
369
  content: '';
386
370
 
387
371
  @include reduced-motion {
@@ -398,21 +382,17 @@ $close-icon-size: 13px;
398
382
  }
399
383
 
400
384
  &:hover {
401
- // Fallback for browsers without color-mix
402
- background-color: rgba(99, 91, 255, 0.4);
403
- background-color: color-mix(in srgb, $primary 40%, #ffffff 60%);
385
+ // Use Vuetify primary color with rgba
386
+ background-color: rgba(var(--v-theme-primary, 99, 91, 255), 0.15);
404
387
 
405
- &::before,
406
- &::after {
407
- background-color: #fff;
388
+ // Fallback for browsers with color-mix support
389
+ @supports (background: color-mix(in srgb, red 50%, blue)) {
390
+ background-color: color-mix(in srgb, $primary 15%, transparent);
408
391
  }
409
- }
410
392
 
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%);
393
+ &::before,
394
+ &::after {
395
+ background-color: $primary;
416
396
  }
417
397
  }
418
398
  }
@@ -426,27 +406,25 @@ $close-icon-size: 13px;
426
406
  font-size: $font-size;
427
407
  background: $bg;
428
408
  border: 1px solid $border;
429
- box-shadow: 0 10px 30px rgba(15, 23, 42, 0.15);
409
+ box-shadow: 0 5px 15px -3px rgba(var(--v-shadow-key-umbra-opacity, 0, 0, 0), 0.2),
410
+ 0 8px 20px 1px rgba(var(--v-shadow-key-penumbra-opacity, 0, 0, 0), 0.14),
411
+ 0 3px 24px 2px rgba(var(--v-shadow-key-ambient-opacity, 0, 0, 0), 0.12);
430
412
  border-radius: 8px;
431
413
 
432
- // Dark theme context menu
433
- @include dark-theme {
434
- box-shadow: 0 10px 30px rgba(0, 0, 0, 0.5);
435
- }
436
-
437
414
  a,
438
415
  button {
439
416
  display: block;
440
417
  width: 100%;
441
418
  padding: 0 16px;
442
- line-height: 30px;
419
+ line-height: 32px;
443
420
  text-align: left;
444
421
  background: transparent;
445
422
  border: none;
446
423
  color: inherit;
447
424
  cursor: pointer;
448
425
  font: inherit;
449
- transition: background-color 0.2s ease-in-out;
426
+ transition: background-color 0.2s cubic-bezier(0.4, 0, 0.2, 1),
427
+ color 0.2s cubic-bezier(0.4, 0, 0.2, 1);
450
428
 
451
429
  @include reduced-motion {
452
430
  transition: none;
@@ -459,24 +437,18 @@ $close-icon-size: 13px;
459
437
  }
460
438
 
461
439
  &[aria-disabled='true'] {
462
- color: rgba(148, 163, 184, 0.6);
440
+ color: rgba(var(--v-theme-on-surface, 148, 163, 184), 0.4);
463
441
  pointer-events: none;
464
442
  cursor: not-allowed;
465
-
466
- @include dark-theme {
467
- color: rgba(226, 232, 240, 0.3);
468
- }
469
443
  }
470
444
 
471
445
  &:hover:not([aria-disabled='true']),
472
446
  &:focus-visible:not([aria-disabled='true']) {
473
- // Fallback for browsers without color-mix
474
- background: rgba(99, 91, 255, 0.2);
475
- background: color-mix(in srgb, $primary 20%, #ffffff 80%);
447
+ background: rgba(var(--v-theme-primary, 99, 91, 255), 0.08);
476
448
  color: $primary;
477
449
 
478
- @include dark-theme {
479
- background: color-mix(in srgb, $primary 25%, transparent 75%);
450
+ @supports (background: color-mix(in srgb, red 50%, blue)) {
451
+ background: color-mix(in srgb, $primary 8%, transparent);
480
452
  }
481
453
  }
482
454
  }
@@ -491,7 +463,7 @@ $close-icon-size: 13px;
491
463
  }
492
464
 
493
465
  .router-tab__item.is-active + .router-tab__item {
494
- border-left-color: css-var(--router-tab-border, css-var(--theme-border, $light-border));
466
+ border-left-color: css-var(--router-tab-border, css-var(--v-border-color, css-var(--theme-border, $light-border)));
495
467
  }
496
468
 
497
469
  // Container query support (progressive enhancement)
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "vue3-router-tab",
3
- "version": "1.1.5",
3
+ "version": "1.1.7",
4
4
  "type": "module",
5
5
  "files": [
6
6
  "dist",