Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

fix: replace div with button for a11y #62

Merged
merged 1 commit into from
Aug 14, 2023
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
19 changes: 12 additions & 7 deletions models/icon.js
Original file line number Diff line number Diff line change
Expand Up @@ -11,26 +11,31 @@ export default class Icon {

#createIcon() {
return `
<div id="chorus-icon" class="chorus-hover-white" role="snip" aria-label="Edit Snip">
<button
role="snip"
id="chorus-icon"
aria-label="Edit Snip"
class="chorus-hover-white"
style="padding:0 6px;border:none;background:none;display:flex;justify-content:center;align-items:center;"
>
<svg
xmlns="http://www.w3.org/2000/svg"
fill="none"
width="1.25rem"
height="1.25rem"
viewBox="0 0 24 24"
stroke-width="1.5"
stroke="currentColor"
width="2rem"
height="2rem"
style="padding: 0.375rem;"
preserveAspectRatio="xMidYMid meet"
id="chorus-highlight"
preserveAspectRatio="xMidYMid meet"
xmlns="http://www.w3.org/2000/svg"
>
<path
stroke-linecap="round"
stroke-linejoin="round"
d="M10.5 6h9.75M10.5 6a1.5 1.5 0 11-3 0m3 0a1.5 1.5 0 10-3 0M3.75 6H7.5m3 12h9.75m-9.75 0a1.5 1.5 0 01-3 0m3 0a1.5 1.5 0 00-3 0m-3.75 0H7.5m9-6h3.75m-3.75 0a1.5 1.5 0 01-3 0m3 0a1.5 1.5 0 00-3 0m-9.75 0h9.75"
/>
</svg>
</div>
</button>
`
}
}
9 changes: 0 additions & 9 deletions styles.css
Original file line number Diff line number Diff line change
Expand Up @@ -27,15 +27,6 @@
position: absolute;
}

#chorus-icon {
display: flex;
flex-wrap: wrap;
justify-content: center;
width: 2rem;
height: 2rem;
cursor: pointer;
}

#chorus-snip-controls {
border: 1px dashed #1ed760;
}
Expand Down