Skip to content

Commit 6a1d9aa

Browse files
authored
fix(Cards): a11y fixes (#261)
- Add `title` attribute to card titles so that users can hover over card titles to see full title - Add `<title>` nodes to OverflowMenu SVG for a11y - Change `h3` and `h4` elements to `p` elements and use new typography classes for font-size
1 parent 0d4194a commit 6a1d9aa

File tree

2 files changed

+5
-3
lines changed

2 files changed

+5
-3
lines changed

src/components/card/card--with-status.html

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,6 +3,7 @@
33
<!-- OverflowMenu -->
44
<div data-overflow-menu class="bx--overflow-menu" tabindex="0" aria-label="List of options">
55
<svg class="bx--overflow-menu__icon" width="4" height="20" viewBox="0 0 4 20" fill-rule="evenodd">
6+
<title>list of options</title>
67
<circle cx="2" cy="2" r="2"></circle>
78
<circle cx="2" cy="10" r="2"></circle>
89
<circle cx="2" cy="18" r="2"></circle>
@@ -30,7 +31,7 @@
3031
<img src="/globals/assets/images/placeholder-icon-32x32.svg" alt="" class="bx--about__icon--img" />
3132
</figure>
3233
<header class="bx--about__title">
33-
<h3 id="card-title-1" class="bx--about__title--name">Card Name</h3>
34+
<p id="card-title-1" class="bx--about__title--name bx--type-gamma">Card Name</p>
3435
<a href="" class="bx--link bx--about__title--link">Secondary Information</a>
3536
</header>
3637
</div>

src/components/card/card.html

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -3,6 +3,7 @@
33
<!-- OverflowMenu -->
44
<div data-overflow-menu class="bx--overflow-menu" tabindex="0" aria-label="List of options">
55
<svg class="bx--overflow-menu__icon" width="4" height="20" viewBox="0 0 4 20" fill-rule="evenodd">
6+
<title>list of options</title>
67
<circle cx="2" cy="2" r="2"></circle>
78
<circle cx="2" cy="10" r="2"></circle>
89
<circle cx="2" cy="18" r="2"></circle>
@@ -30,8 +31,8 @@
3031
<img src="/globals/assets/images/placeholder-icon-32x32.svg" alt="" class="bx--about__icon--img" />
3132
</figure>
3233
<header class="bx--about__title">
33-
<h3 id="card-title-2" class="bx--about__title--name">Card Name</h3>
34-
<h4 class="bx--about__title--additional-info">Secondary Information</h4>
34+
<p id="card-title-2" class="bx--about__title--name bx--type-gamma" title="Card Name">Card Name</p>
35+
<p class="bx--about__title--additional-info bx--type-delta">Secondary Information</p>
3536
</header>
3637
</div>
3738
</section>

0 commit comments

Comments
 (0)