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

a11y improvements for template to-do list #1207

Merged
merged 6 commits into from
Apr 28, 2021
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
5 changes: 5 additions & 0 deletions .changeset/lovely-apricots-fail.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
---
'create-svelte': patch
---

Improve a11y on to-do list in template
Original file line number Diff line number Diff line change
Expand Up @@ -60,7 +60,7 @@
form.reset();
}
}}>
<input name="text" placeholder="+ tap to add a todo">
<input name="text" aria-label="Add todo" placeholder="+ tap to add a todo">
</form>

{#each todos as todo (todo.uid)}
Expand All @@ -78,7 +78,7 @@
<form class="text" action="/todos/{todo.uid}.json?_method=patch" method="post" use:enhance={{
result: patch
}}>
<input type="text" name="text" value={todo.text}>
<input aria-label="Edit todo" type="text" name="text" value={todo.text}>
<button class="save" aria-label="Save todo"/>
</form>

Expand Down Expand Up @@ -184,7 +184,8 @@
opacity: 0.2;
}

.delete:hover {
.delete:hover,
.delete:focus {
transition: opacity 0.2s;
opacity: 1;
}
Expand All @@ -196,7 +197,8 @@
background-image: url("data:image/svg+xml,%3Csvg width='24' height='24' viewBox='0 0 24 24' fill='none' xmlns='http://www.w3.org/2000/svg'%3E%3Cpath d='M20.5 2H3.5C2.67158 2 2 2.67157 2 3.5V20.5C2 21.3284 2.67158 22 3.5 22H20.5C21.3284 22 22 21.3284 22 20.5V3.5C22 2.67157 21.3284 2 20.5 2Z' fill='%23676778' stroke='%23676778' stroke-width='1.5' stroke-linejoin='round'/%3E%3Cpath d='M17 2V11H7.5V2H17Z' fill='white' stroke='white' stroke-width='1.5' stroke-linejoin='round'/%3E%3Cpath d='M13.5 5.5V7.5' stroke='%23676778' stroke-width='1.5' stroke-linecap='round'/%3E%3Cpath d='M5.99844 2H18.4992' stroke='%23676778' stroke-width='1.5' stroke-linecap='round'/%3E%3C/svg%3E%0A");
}

.todo input:focus + .save {
.todo input:focus + .save,
.save:focus {
transition: opacity 0.2s;
opacity: 1;
}
Expand Down