Skip to content

Commit 06d4fa7

Browse files
csrsalexdor
authored andcommitted
Accessibility improvements on club listing page and leaders corner page (#293)
* Accessibility improvements on club listing page and leaders corner page * Added underline to paragraph-level links, and subsequently had to remove underline from heading-level links * Added p tag to FAQ page for screen readers * Added null check for aria labels * deleted line instead of commenting out
1 parent 6a41bbe commit 06d4fa7

File tree

22 files changed

+70
-19
lines changed

22 files changed

+70
-19
lines changed

Diff for: src/components/base-styles/base/links/_links.scss

-1
Original file line numberDiff line numberDiff line change
@@ -15,7 +15,6 @@
1515
a,
1616
%link {
1717
color: color(link);
18-
text-decoration: none;
1918
transition: .2s cubic-bezier(.190, 1.000, .220, 1.000); /* easeOutExpo */
2019
}
2120

Diff for: src/components/components/announcements/announcements.js

+4-2
Original file line numberDiff line numberDiff line change
@@ -17,8 +17,10 @@ export default props => {
1717

1818
return (
1919
<div>
20-
<h2 className="teaser-box__list-title"> Latest announcements </h2>
21-
<div>
20+
<h2 className="teaser-box__list-title" id="announcements">
21+
Latest announcements
22+
</h2>
23+
<div aria-labelledby="announcements">
2224
<TeaserBoxList items={items} dummyData={props.dummyData} />
2325
</div>
2426
</div>

Diff for: src/components/components/club-teaser-list/club-teaser-list.js

+12-3
Original file line numberDiff line numberDiff line change
@@ -20,17 +20,26 @@ export const ClubTeaser = props => {
2020
const image = props.club.imageUrl;
2121
const classes = props.className ? props.className : "";
2222
return (
23-
<Link to={`/clubs/${props.club.id}`} className={`${classes} club-teaser`}>
23+
<Link
24+
to={`/clubs/${props.club.id}`}
25+
className={`${classes} club-teaser`}
26+
aria-labelledby={title.replace(/\s/g, "")}
27+
>
2428
<ShadowBox className="club-teaser__inner">
2529
<div className="club-teaser__image-wrapper">
2630
<img
2731
src={image || groupSmallImage}
28-
alt={title}
32+
alt={`${title} club logo`}
2933
className="club-teaser__image"
3034
/>
3135
</div>
3236
<div className="club-teaser__text">
33-
<h2 className="club-teaser__title">{title}</h2>
37+
<h2
38+
className="club-teaser__title"
39+
id={(title || "").replace(/\s/g, "")}
40+
>
41+
{title}
42+
</h2>
3443
<span className="club-teaser__description"> {subtitle} </span>
3544
<div className="button button--x-small club-teaser__button">
3645
Club page <ChevronRight size={16} className="icon" />

Diff for: src/components/components/club-teaser-list/club-teaser.scss

+1
Original file line numberDiff line numberDiff line change
@@ -6,6 +6,7 @@
66
.club-teaser {
77
color: color('text');
88
display: flex;
9+
text-decoration: none;
910

1011
&__inner {
1112
@include padding-top(20px);

Diff for: src/components/components/communication-channels/communication-channels.js

+10-2
Original file line numberDiff line numberDiff line change
@@ -48,10 +48,18 @@ export const ChannelList = props => {
4848

4949
return (
5050
<div className="communication-channels__list">
51-
<h2 className="communication-channels__list-title title title--x-small">
51+
<h2
52+
className="communication-channels__list-title title title--x-small"
53+
id="communication"
54+
>
5255
Communication channels
5356
</h2>
54-
<div className="communication-channels__list-wrapper">{channels}</div>
57+
<div
58+
className="communication-channels__list-wrapper"
59+
aria-labelledby="communication"
60+
>
61+
{channels}
62+
</div>
5563
</div>
5664
);
5765
};

Diff for: src/components/components/communication-channels/communication-channels.scss

+1
Original file line numberDiff line numberDiff line change
@@ -7,6 +7,7 @@
77
.communication-channels {
88
text-align: center;
99
margin-bottom: 5px;
10+
text-decoration: none;
1011

1112
&__image {
1213
max-width: 100%;

Diff for: src/components/components/contributing-tools/contributing-tools.js

+1-1
Original file line numberDiff line numberDiff line change
@@ -25,7 +25,7 @@ export const ContributingToolSet = props => {
2525

2626
return (
2727
<div>
28-
<h2> Tools for contributing code to open source projects </h2>
28+
<h2>Tools for contributing code to open source projects</h2>
2929
<MediaQuery maxWidth={767}>
3030
<LayoutScroll>{tools}</LayoutScroll>
3131
</MediaQuery>

Diff for: src/components/components/external-link-box/external-link-box.scss

+1
Original file line numberDiff line numberDiff line change
@@ -13,6 +13,7 @@
1313
flex-direction: column;
1414
max-width: 160px;
1515
min-height: 120px;
16+
text-decoration: none;
1617

1718
@include breakpoint($tablet) {
1819
max-width: 100%;

Diff for: src/components/components/faq-group/faq-group.js

+12-2
Original file line numberDiff line numberDiff line change
@@ -13,9 +13,19 @@ export default props => {
1313
<div className={classes}>
1414
<ShadowBox>
1515
<div className="faq__group-header">
16-
<h2 title="title title--x-small">{props.header}</h2>
16+
<h2
17+
title="title title--x-small"
18+
id={(props.header || "").replace(/\s/g, "")}
19+
>
20+
{props.header}
21+
</h2>
1722
</div>
18-
<ul className="faq__group-content">{props.children}</ul>
23+
<ul
24+
className="faq__group-content"
25+
aria-labelledby={(props.header || "").replace(/\s/g, "")}
26+
>
27+
{props.children}
28+
</ul>
1929
</ShadowBox>
2030
</div>
2131
);

Diff for: src/components/components/faq-item/faq-item.js

+1-1
Original file line numberDiff line numberDiff line change
@@ -48,7 +48,7 @@ class FaqItem extends React.PureComponent {
4848
</button>
4949
</h3>
5050
<div id={id} className="faq__item-content" hidden={isHidden}>
51-
{this.props.children}
51+
<p>{this.props.children}</p>
5252
</div>
5353
</li>
5454
);

Diff for: src/components/components/footer/footer.scss

+1-1
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,7 @@
1111

1212
a {
1313
color: color('white');
14-
14+
text-decoration: none;
1515
&:hover,
1616
&:focus {
1717
color: color('white');

Diff for: src/components/components/job-listing/job-listing.js

+4-2
Original file line numberDiff line numberDiff line change
@@ -17,8 +17,10 @@ export default props => {
1717

1818
return (
1919
<div>
20-
<h2 className="teaser-box__list-title"> Jobs & internships board </h2>
21-
<div>
20+
<h2 className="teaser-box__list-title" id="jobs">
21+
Jobs & internships board
22+
</h2>
23+
<div aria-labelledby="jobs">
2224
<TeaserBoxList items={items} dummyData={props.dummyData} />
2325
</div>
2426
</div>

Diff for: src/components/components/join-cta/join-cta.scss

+2-1
Original file line numberDiff line numberDiff line change
@@ -10,6 +10,7 @@
1010
display: flex;
1111
width: 100%;
1212
max-width: 350px;
13+
text-decoration: none;
1314
@include margin-top(1);
1415

1516
@include breakpoint($desktop) {
@@ -131,4 +132,4 @@
131132
}
132133
}
133134
}
134-
}
135+
}

Diff for: src/components/components/leader-tools/leader-tools.js

+6-1
Original file line numberDiff line numberDiff line change
@@ -62,7 +62,11 @@ export class LeaderToolList extends React.PureComponent {
6262
* Creates the tool header.
6363
*/
6464
getSimpleHeader() {
65-
return <span className="title title--x-small"> {this.props.title} </span>;
65+
return (
66+
<span className="title title--x-small" id={this.props.detailsId}>
67+
{this.props.title}
68+
</span>
69+
);
6670
}
6771

6872
/**
@@ -129,6 +133,7 @@ export class LeaderToolList extends React.PureComponent {
129133
className="leader-tools-list"
130134
hidden={hideDetails}
131135
aria-hidden={hideDetails}
136+
aria-labelledby={this.props.detailsId}
132137
>
133138
{tools}
134139
</ul>

Diff for: src/components/components/member-teaser/member-teaser.scss

+1
Original file line numberDiff line numberDiff line change
@@ -9,6 +9,7 @@
99
display: flex;
1010
width: 100%;
1111
height: 100%;
12+
text-decoration: none;
1213

1314
&__inner {
1415
display: flex;

Diff for: src/components/components/member-training-resources/member-training-resources.js

+5-2
Original file line numberDiff line numberDiff line change
@@ -69,10 +69,13 @@ export default props => {
6969

7070
return (
7171
<LayoutContained>
72-
<h2 className="member-training-resources__list-title">
72+
<h2 className="member-training-resources__list-title" id="resources">
7373
Training & various resources
7474
</h2>
75-
<div className="member-training-resources__list">
75+
<div
76+
className="member-training-resources__list"
77+
aria-labelledby="resources"
78+
>
7679
<MediaQuery maxWidth={767}>
7780
<LayoutScroll stretchItems>{resources}</LayoutScroll>
7881
</MediaQuery>

Diff for: src/components/components/member-training-resources/member-training-resources.scss

+1
Original file line numberDiff line numberDiff line change
@@ -27,6 +27,7 @@
2727
padding: 0;
2828
display: flex;
2929
height: 100%;
30+
text-decoration: none;
3031
}
3132

3233
&__image-wrapper {

Diff for: src/components/components/member/member.scss

+3
Original file line numberDiff line numberDiff line change
@@ -91,6 +91,9 @@
9191
word-break: break-all;
9292
margin-left: auto;
9393
margin-right: auto;
94+
a {
95+
text-decoration: none;
96+
}
9497
}
9598

9699
&__link-content {

Diff for: src/components/components/organization/organization.scss

+1
Original file line numberDiff line numberDiff line change
@@ -5,6 +5,7 @@
55
// Used for organization page listing.
66
.organization {
77
display: flex;
8+
text-decoration: none;
89

910
&__inner {
1011
padding: 5px;

Diff for: src/components/components/teaser-box/teaser-box.scss

+1
Original file line numberDiff line numberDiff line change
@@ -35,6 +35,7 @@
3535
&__wrapper-link {
3636
width: 100%;
3737
display: flex;
38+
text-decoration: none;
3839
}
3940

4041
&__link-inner {

Diff for: src/components/navigation/main-navigation/main-navigation.scss

+1
Original file line numberDiff line numberDiff line change
@@ -104,6 +104,7 @@
104104
display: inline-block;
105105
padding-top: 0;
106106
padding-bottom: 0;
107+
text-decoration: none;
107108
}
108109
}
109110
}

Diff for: src/components/navigation/secondary-navigation/secondary-navigation.scss

+1
Original file line numberDiff line numberDiff line change
@@ -15,6 +15,7 @@
1515
@include font-size(18px);
1616
@include line-height(27px);
1717
color: color('navigation');
18+
text-decoration: none;
1819
transition: .3s cubic-bezier(0.19, 1, 0.22, 1);
1920
display: block;
2021
padding-top: 5px;

0 commit comments

Comments
 (0)