Skip to content

Commit bfa295e

Browse files
authored
Merge pull request #103 from myrdn/main
Accessibility : Add keyboard control using html buttons
2 parents 4aa7a4e + f6b6064 commit bfa295e

File tree

2 files changed

+16
-5
lines changed

2 files changed

+16
-5
lines changed

src/components/Arrow/Arrow.svelte

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

15-
<div
15+
<button
1616
class="sc-carousel-arrow__circle"
1717
class:sc-carousel-arrow__circle_disabled={disabled}
1818
on:click
@@ -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/Dot/Dot.svelte

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

8-
<div
8+
<button
99
class="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+
21+
button {
22+
all: unset;
23+
cursor: pointer;
24+
}
25+
26+
button:focus {
27+
outline: 1px dotted #212121;
28+
outline: 5px auto -webkit-focus-ring-color;
29+
}
30+
2031
.sc-carousel-dot__dot {
2132
background-color: var(--sc-color-rgb-light);
2233
border-radius: 50%;

0 commit comments

Comments
 (0)