Skip to content

Commit 2ee1c5a

Browse files
authored
feat(Carousel): allow customization of active dot color (#4229)
1 parent 62bc7b2 commit 2ee1c5a

File tree

2 files changed

+2
-1
lines changed

2 files changed

+2
-1
lines changed

src/runtime/components/Carousel.vue

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -336,6 +336,7 @@ defineExpose({
336336
<button
337337
:aria-label="t('carousel.goto', { slide: index + 1 })"
338338
:class="ui.dot({ class: props.ui?.dot, active: selectedIndex === index })"
339+
:data-state="selectedIndex === index ? 'active' : undefined"
339340
@click="scrollTo(index)"
340341
/>
341342
</template>

src/theme/carousel.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -30,7 +30,7 @@ export default (options: Required<ModuleOptions>) => ({
3030
},
3131
active: {
3232
true: {
33-
dot: 'bg-inverted'
33+
dot: 'data-[state=active]:bg-inverted'
3434
}
3535
}
3636
}

0 commit comments

Comments
 (0)