Skip to content

Commit 981f08a

Browse files
authored
Improve accessibility (#36)
1 parent 825cc02 commit 981f08a

File tree

2 files changed

+38
-26
lines changed

2 files changed

+38
-26
lines changed

index.css

Lines changed: 38 additions & 26 deletions
Original file line numberDiff line numberDiff line change
@@ -33,10 +33,6 @@ body {
3333
font-weight: 300;
3434
}
3535

36-
:focus {
37-
outline: 0;
38-
}
39-
4036
.hidden {
4137
display: none;
4238
}
@@ -51,19 +47,19 @@ body {
5147

5248
.todoapp input::-webkit-input-placeholder {
5349
font-style: italic;
54-
font-weight: 300;
50+
font-weight: 400;
5551
color: rgba(0, 0, 0, 0.4);
5652
}
5753

5854
.todoapp input::-moz-placeholder {
5955
font-style: italic;
60-
font-weight: 300;
56+
font-weight: 400;
6157
color: rgba(0, 0, 0, 0.4);
6258
}
6359

6460
.todoapp input::input-placeholder {
6561
font-style: italic;
66-
font-weight: 300;
62+
font-weight: 400;
6763
color: rgba(0, 0, 0, 0.4);
6864
}
6965

@@ -100,6 +96,7 @@ body {
10096

10197
.new-todo {
10298
padding: 16px 16px 16px 60px;
99+
height: 65px;
103100
border: none;
104101
background: rgba(0, 0, 0, 0.003);
105102
box-shadow: inset 0 -2px 1px rgba(0,0,0,0.03);
@@ -122,25 +119,29 @@ body {
122119
}
123120

124121
.toggle-all + label {
125-
width: 60px;
126-
height: 34px;
122+
display: flex;
123+
align-items: center;
124+
justify-content: center;
125+
width: 45px;
126+
height: 65px;
127127
font-size: 0;
128128
position: absolute;
129-
top: -52px;
130-
left: -13px;
131-
-webkit-transform: rotate(90deg);
132-
transform: rotate(90deg);
129+
top: -65px;
130+
left: -0;
133131
}
134132

135133
.toggle-all + label:before {
136134
content: '❯';
135+
display: inline-block;
137136
font-size: 22px;
138-
color: #e6e6e6;
137+
color: #949494;
139138
padding: 10px 27px 10px 27px;
139+
-webkit-transform: rotate(90deg);
140+
transform: rotate(90deg);
140141
}
141142

142143
.toggle-all:checked + label:before {
143-
color: #737373;
144+
color: #484848;
144145
}
145146

146147
.todo-list {
@@ -198,13 +199,13 @@ body {
198199
Firefox requires `#` to be escaped - https://bugzilla.mozilla.org/show_bug.cgi?id=922433
199200
IE and Edge requires *everything* to be escaped to render, so we do that instead of just the `#` - https://developer.microsoft.com/en-us/microsoft-edge/platform/issues/7157459/
200201
*/
201-
background-image: url('data:image/svg+xml;utf8,%3Csvg%20xmlns%3D%22http%3A//www.w3.org/2000/svg%22%20width%3D%2240%22%20height%3D%2240%22%20viewBox%3D%22-10%20-18%20100%20135%22%3E%3Ccircle%20cx%3D%2250%22%20cy%3D%2250%22%20r%3D%2250%22%20fill%3D%22none%22%20stroke%3D%22%23ededed%22%20stroke-width%3D%223%22/%3E%3C/svg%3E');
202+
background-image: url('data:image/svg+xml;utf8,%3Csvg%20xmlns%3D%22http%3A//www.w3.org/2000/svg%22%20width%3D%2240%22%20height%3D%2240%22%20viewBox%3D%22-10%20-18%20100%20135%22%3E%3Ccircle%20cx%3D%2250%22%20cy%3D%2250%22%20r%3D%2250%22%20fill%3D%22none%22%20stroke%3D%22%23949494%22%20stroke-width%3D%223%22/%3E%3C/svg%3E');
202203
background-repeat: no-repeat;
203204
background-position: center left;
204205
}
205206

206207
.todo-list li .toggle:checked + label {
207-
background-image: url('data:image/svg+xml;utf8,%3Csvg%20xmlns%3D%22http%3A//www.w3.org/2000/svg%22%20width%3D%2240%22%20height%3D%2240%22%20viewBox%3D%22-10%20-18%20100%20135%22%3E%3Ccircle%20cx%3D%2250%22%20cy%3D%2250%22%20r%3D%2250%22%20fill%3D%22none%22%20stroke%3D%22%23bddad5%22%20stroke-width%3D%223%22/%3E%3Cpath%20fill%3D%22%235dc2af%22%20d%3D%22M72%2025L42%2071%2027%2056l-4%204%2020%2020%2034-52z%22/%3E%3C/svg%3E');
208+
background-image: url('data:image/svg+xml;utf8,%3Csvg%20xmlns%3D%22http%3A%2F%2Fwww.w3.org%2F2000%2Fsvg%22%20width%3D%2240%22%20height%3D%2240%22%20viewBox%3D%22-10%20-18%20100%20135%22%3E%3Ccircle%20cx%3D%2250%22%20cy%3D%2250%22%20r%3D%2250%22%20fill%3D%22none%22%20stroke%3D%22%2359A193%22%20stroke-width%3D%223%22%2F%3E%3Cpath%20fill%3D%22%233EA390%22%20d%3D%22M72%2025L42%2071%2027%2056l-4%204%2020%2020%2034-52z%22%2F%3E%3C%2Fsvg%3E');
208209
}
209210

210211
.todo-list li label {
@@ -214,11 +215,11 @@ body {
214215
line-height: 1.2;
215216
transition: color 0.4s;
216217
font-weight: 400;
217-
color: #4d4d4d;
218+
color: #484848;
218219
}
219220

220221
.todo-list li.completed label {
221-
color: #cdcdcd;
222+
color: #949494;
222223
text-decoration: line-through;
223224
}
224225

@@ -232,17 +233,20 @@ body {
232233
height: 40px;
233234
margin: auto 0;
234235
font-size: 30px;
235-
color: #cc9a9a;
236-
margin-bottom: 11px;
236+
color: #949494;
237237
transition: color 0.2s ease-out;
238238
}
239239

240-
.todo-list li .destroy:hover {
241-
color: #af5b5e;
240+
.todo-list li .destroy:hover,
241+
.todo-list li .destroy:focus {
242+
color: #C18585;
242243
}
243244

244245
.todo-list li .destroy:after {
245246
content: '×';
247+
display: block;
248+
height: 100%;
249+
line-height: 1.1;
246250
}
247251

248252
.todo-list li:hover .destroy {
@@ -312,18 +316,18 @@ body {
312316
}
313317

314318
.filters li a:hover {
315-
border-color: rgba(175, 47, 47, 0.1);
319+
border-color: #DB7676;
316320
}
317321

318322
.filters li a.selected {
319-
border-color: rgba(175, 47, 47, 0.2);
323+
border-color: #CE4646;
320324
}
321325

322326
.clear-completed,
323327
html .clear-completed:active {
324328
float: right;
325329
position: relative;
326-
line-height: 20px;
330+
line-height: 19px;
327331
text-decoration: none;
328332
cursor: pointer;
329333
}
@@ -378,3 +382,11 @@ html .clear-completed:active {
378382
bottom: 10px;
379383
}
380384
}
385+
386+
:focus,
387+
.toggle:focus + label,
388+
.toggle-all:focus + label {
389+
box-shadow: 0 0 2px 2px #CF7D7D;
390+
outline: 0;
391+
z-index: 3;
392+
}

screenshot.png

44.3 KB
Loading

0 commit comments

Comments
 (0)