Skip to content

Commit 6ccaee3

Browse files
committed
record: Rework HTML markup for records
* Use `<ARTICLE/>` for the overall record container; each track remains its own `<SECTION/>` which makes more semantic sense. * Use `<ASIDE/>` instead of `<UL/>` for track information. This is the intent for this tag (ancillary information about the section it appears inside or next to), and fixes the accessibility issue of improperly using a list for markup of something that is not a list. Closes: ADA-670
1 parent 9ece7f0 commit 6ccaee3

File tree

4 files changed

+12
-11
lines changed

4 files changed

+12
-11
lines changed

app/assets/stylesheets/includes/desktop.scss

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -104,7 +104,7 @@
104104
}
105105
}
106106

107-
section {
107+
article {
108108
&.record {
109109
h1 {
110110
line-height: $line-height;

app/assets/stylesheets/includes/main.scss

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -169,7 +169,9 @@ section {
169169
margin-bottom: $margin;
170170
width: 100%;
171171
}
172+
}
172173

174+
article {
173175
&.record {
174176
align-items: center;
175177
display: flex;
@@ -225,7 +227,7 @@ section {
225227
}
226228
}
227229

228-
ul {
230+
aside {
229231
&.track-info {
230232
display: flex;
231233
flex-direction: row;
@@ -234,8 +236,7 @@ section {
234236
list-style-type: none;
235237
margin-bottom: $margin-small;
236238

237-
li {
238-
display: block;
239+
div {
239240
padding-left: $margin-small;
240241

241242
&:not(:last-of-type) {

app/assets/stylesheets/includes/mobile.scss

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -141,7 +141,7 @@
141141
}
142142
}
143143

144-
section {
144+
article {
145145
&.record {
146146
h1 {
147147
line-height: $line-height-xsmall;

app/views/player/_record.html.erb

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@
22

33
<%= render(partial: 'player_head_additional') %>
44

5-
<section class="record">
5+
<article class="record">
66

77
<h1><%= record.title %></h1>
88

@@ -23,14 +23,14 @@
2323
%>
2424
<%= render(partial: track.player_partial, locals: locals) %>
2525
<% if track.duration || !track.title.blank? %>
26-
<ul class="track-info">
26+
<aside class="track-info">
2727
<% unless track.title.blank? %>
28-
<li><%= track.title %></li>
28+
<div><%= track.title %></div>
2929
<% end %>
3030
<% if track.duration %>
31-
<li><%= track.duration %></li>
31+
<div><%= track.duration %></div>
3232
<% end %>
33-
</ul>
33+
</aside>
3434
<% end %>
3535
</section>
3636
<% end %>
@@ -90,7 +90,7 @@
9090
</tbody>
9191
</table>
9292
93-
</section>
93+
</article>
9494
9595
<!--
9696
<%= render(partial: 'debug', formats: :text, locals: { record: record }) %>

0 commit comments

Comments
 (0)