Skip to content

Commit 3898479

Browse files
author
GlobalHive
committed
fix(VTour): update dynamic IDs for tooltips and backdrops
BREAKING CHANGE: CSS changes, check your custom designs * Prefix tooltip and backdrop IDs with 'vjt-' for consistency * Adjust highlight class naming for better clarity
1 parent 465c539 commit 3898479

2 files changed

Lines changed: 16 additions & 16 deletions

File tree

src/components/VTour.vue

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -90,11 +90,11 @@ const isTransitioning = ref(false); // Hide tooltip during step transitions
9090
// Empty name = backward compatible IDs (vjt-tooltip, vjt-backdrop)
9191
// Non-empty name = scoped IDs (vjt-myname-tooltip, vjt-myname-backdrop)
9292
const tourId = computed(() => (props.name ? `vjt-${props.name}` : 'vjt'));
93-
const tooltipId = computed(() => `${tourId.value}-tooltip`);
94-
const backdropId = computed(() => `${tourId.value}-backdrop`);
95-
const arrowId = computed(() => `${tourId.value}-arrow`);
93+
const tooltipId = computed(() => `${tourId.value}-vjt-tooltip`);
94+
const backdropId = computed(() => `${tourId.value}-vjt-backdrop`);
95+
const arrowId = computed(() => `${tourId.value}-vjt-arrow`);
9696
const highlightClass = computed(() =>
97-
props.name ? `vjt-highlight-${props.name}` : 'vjt-highlight'
97+
props.name ? `${props.name}vjt-highlight` : 'vjt-highlight'
9898
);
9999
100100
// Cache DOM element references (populated after Teleport renders)

src/style/style.scss

Lines changed: 12 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -21,7 +21,7 @@
2121
}
2222

2323
// Support multiple tour instances with dynamic IDs
24-
[id$="-backdrop"]{
24+
[id$="-vjt-backdrop"]{
2525
position: fixed;
2626
top: 0;
2727
left: 0;
@@ -35,7 +35,7 @@
3535
}
3636
}
3737

38-
[id$="-tooltip"] {
38+
[id$="-vjt-tooltip"] {
3939
background-color: $vjt__tooltip_background;
4040
color: $vjt__tooltip_color;
4141
padding: 0.5rem;
@@ -48,35 +48,35 @@
4848
}
4949

5050

51-
[id$="-tooltip"][data-arrow^='t'] {
52-
[id$="-arrow"] {
51+
[id$="-vjt-tooltip"][data-arrow^='t'] {
52+
[id$="-vjt-arrow"] {
5353
bottom: math.div(-$vjt__tooltip_arrow_size, 2);
5454
right: 50%;
5555
}
5656
}
5757

58-
[id$="-tooltip"][data-arrow^='b'] {
59-
[id$="-arrow"] {
58+
[id$="-vjt-tooltip"][data-arrow^='b'] {
59+
[id$="-vjt-arrow"] {
6060
top: math.div(-$vjt__tooltip_arrow_size, 2);
6161
right: 50%;
6262
}
6363
}
6464

65-
[id$="-tooltip"][data-arrow^='l'] {
66-
[id$="-arrow"] {
65+
[id$="-vjt-tooltip"][data-arrow^='l'] {
66+
[id$="-vjt-arrow"] {
6767
right: math.div(-$vjt__tooltip_arrow_size, 2);
6868
top: 50%;
6969
}
7070
}
7171

72-
[id$="-tooltip"][data-arrow^='r'] {
73-
[id$="-arrow"] {
72+
[id$="-vjt-tooltip"][data-arrow^='r'] {
73+
[id$="-vjt-arrow"] {
7474
left: math.div(-$vjt__tooltip_arrow_size, 2);
7575
top: 50%;
7676
}
7777
}
7878

79-
[id$="-arrow"] {
79+
[id$="-vjt-arrow"] {
8080
width: $vjt__tooltip_arrow_size;
8181
height: $vjt__tooltip_arrow_size;
8282
position: absolute;
@@ -93,7 +93,7 @@
9393
}
9494

9595
// Support multiple tour instances with dynamic highlight classes
96-
[class*="vjt-highlight-"] {
96+
[class*="vjt-highlight"] {
9797
outline: $vjt__highlight_outline;
9898
outline-offset: $vjt__highlight_offset;
9999
border-radius: $vjt__highlight_outline_radius;

0 commit comments

Comments
 (0)