Skip to content

Commit 6c17b22

Browse files
authored
Merge pull request #108 from vadimkorr/feature/#101_Keyboard-control
#101 Keyboard control
2 parents 4aa7a4e + c6679b5 commit 6c17b22

File tree

3 files changed

+15
-7
lines changed

3 files changed

+15
-7
lines changed

src/components/Arrow/Arrow.svelte

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -12,8 +12,8 @@
1212
export let disabled = false
1313
</script>
1414

15-
<div
16-
class="sc-carousel-arrow__circle"
15+
<button
16+
class="sc-carousel-button sc-carousel-arrow__circle"
1717
class:sc-carousel-arrow__circle_disabled={disabled}
1818
on:click
1919
>
@@ -22,7 +22,7 @@
2222
class:sc-carousel-arrow__arrow-next={direction === NEXT}
2323
class:sc-carousel-arrow__arrow-prev={direction === PREV}
2424
></i>
25-
</div>
25+
</button>
2626

2727
<style>
2828
:root {
@@ -61,4 +61,4 @@
6161
.sc-carousel-arrow__circle_disabled:hover {
6262
opacity: 0.5;
6363
}
64-
</style>
64+
</style>

src/components/Carousel/Carousel.svelte

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -368,4 +368,11 @@
368368
position: absolute;
369369
bottom: 0;
370370
}
371+
:global(.sc-carousel-button) {
372+
all: unset;
373+
cursor: pointer;
374+
}
375+
:global(.sc-carousel-button:focus) {
376+
outline: 5px auto;
377+
}
371378
</style>

src/components/Dot/Dot.svelte

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -5,18 +5,19 @@
55
export let active = false
66
</script>
77

8-
<div
9-
class="sc-carousel-dot__dot"
8+
<button
9+
class="sc-carousel-button sc-carousel-dot__dot"
1010
class:sc-carousel-dot__dot_active={active}
1111
on:click
12-
></div>
12+
></button>
1313

1414
<style>
1515
:root {
1616
--sc-dot-size: 6px;
1717
--sc-active-dot-size: 8px;
1818
--sc-dot-size-animation-time: 250ms;
1919
}
20+
2021
.sc-carousel-dot__dot {
2122
background-color: var(--sc-color-rgb-light);
2223
border-radius: 50%;

0 commit comments

Comments
 (0)