Skip to content

Commit 0e0b951

Browse files
Re-order card markup for better accessibility
I tried the page with NVDA, and the aria-label approach didn't work (apparently it's not valid for 'li' tags). So instead, I just tweaked the markup to properly present the item's title first.
1 parent d590340 commit 0e0b951

File tree

2 files changed

+13
-8
lines changed

2 files changed

+13
-8
lines changed

sass/_extra.scss

+5
Original file line numberDiff line numberDiff line change
@@ -45,6 +45,11 @@
4545
height: 256px;
4646
}
4747

48+
.ui.cards > .card > .content > .header:not(.ui), .ui.card > .content > .header:not(.ui) {
49+
display: inline-block;
50+
margin-bottom: 0;
51+
}
52+
4853
.ui.card > .image > img, .ui.cards > .card > .image > img {
4954
object-fit: cover;
5055
width: 100%;

templates/categories/macros.html

+8-8
Original file line numberDiff line numberDiff line change
@@ -98,6 +98,14 @@
9898
{% endif %}
9999

100100
<div class="content">
101+
<h3 class="header">
102+
{% if primary_url %}
103+
<a href="{{ primary_url }}">{{ name }}</a>
104+
{% else %}
105+
{{ name }}
106+
{% endif %}
107+
</h3>
108+
101109
<a class="right floated" href="#{{ name | slugify }}" id="{{ name | slugify }}" aria-label="Permanent link for {{ name }}">
102110
<i class="hashtag icon" aria-hidden="true"></i>
103111
</a>
@@ -120,14 +128,6 @@
120128
</a>
121129
{% endif %}
122130

123-
<div class="header">
124-
{% if primary_url %}
125-
<a href="{{ primary_url }}">{{ name }}</a>
126-
{% else %}
127-
{{ name }}
128-
{% endif %}
129-
</div>
130-
131131
<div class="meta">
132132
{% for category in item.categories %}
133133
{% set category_data = get_page(path="." ~ section.path ~ category ~ ".md") %}

0 commit comments

Comments
 (0)