Skip to content

Commit f704fb9

Browse files
authored
filip(fix): apply EAA amends (#2072)
Added aria labels to carousel buttons Added aria labels to logo links Added alt text to homepage images Updated redundant alt text on Navigation logo image Adjusted heading order on homepage to ensure sequental ordering Contrast: Default ‘hover’/‘selected’/‘active’ colour has too low a contrast ratio with the white background across the site Footer CTA and copyright have too low a contrast ratio with the white background on all non-homepage pages
 both currently not in line with WCAG AA and AAA standards **Lighthouse score is now an overall 96 for Accessibility on Homepage and 92 on all other pages**
2 parents 9184f26 + 17b7013 commit f704fb9

File tree

9 files changed

+33
-12
lines changed

9 files changed

+33
-12
lines changed

docs/docusaurus.config.js

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -161,7 +161,7 @@ const config = {
161161
navbar: {
162162
title: "Hydra Head protocol",
163163
logo: {
164-
alt: "Hydra Head protocol",
164+
alt: "Hydra Head logo",
165165
src: "img/hydra.png",
166166
style: { height: 27, marginTop: 2.5 },
167167
srcDark: "img/hydra-white.png",
@@ -272,7 +272,7 @@ const config = {
272272
theme: lightCodeTheme,
273273
darkTheme: darkCodeTheme,
274274
additionalLanguages: ["haskell"],
275-
}
275+
},
276276
}),
277277

278278
markdown: {

docs/src/components/homepage/Carousel/Carousel.tsx

Lines changed: 14 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -21,7 +21,11 @@ const CarouselEntry: FC<Props> = ({ idx, src, description }) => {
2121
return (
2222
<div className="flex items-center gap-6 h-full justify-center">
2323
<div className="basis-[40%]">
24-
<img src={src} className="w-full rounded-lg object-cover" />
24+
<img
25+
src={src}
26+
className="w-full rounded-lg object-cover"
27+
alt={`How it works panel ${idx}`}
28+
/>
2529
</div>
2630
<div className="flex flex-col gap-4 max-w-md justify-center">
2731
<h4 className="text-2xl text-primary font-medium">How it works</h4>
@@ -52,11 +56,17 @@ type ControlProps = {
5256
const Controls: FC<ControlProps> = ({ showing, handlePrev, handleNext }) => {
5357
return (
5458
<div className="inline-flex gap-4">
55-
<button onClick={handlePrev} disabled={showing < 1}>
59+
<button
60+
onClick={handlePrev}
61+
disabled={showing < 1}
62+
aria-label="Previous slide"
63+
>
5664
<Arrow
5765
className={clsx(
5866
"rotate-180 rounded-full",
59-
showing < 1 ? "text-primary-lightest" : "text-primary hover:bg-primary/15"
67+
showing < 1
68+
? "text-primary-lightest"
69+
: "text-primary hover:bg-primary/15"
6070
)}
6171
/>
6272
</button>
@@ -72,6 +82,7 @@ const Controls: FC<ControlProps> = ({ showing, handlePrev, handleNext }) => {
7282
<button
7383
onClick={handleNext}
7484
disabled={showing > HowItWorksCarouselContent.length - 2}
85+
aria-label="Next slide"
7586
>
7687
<Arrow
7788
className={clsx(

docs/src/components/homepage/CaseStudies.tsx

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -54,6 +54,7 @@ const CaseStudies: FC = () => {
5454
: FeaturedCaseStudy.src
5555
}
5656
className="tablet:rounded-2xl rounded-none"
57+
alt="Case studies blocks"
5758
/>
5859
</motion.div>
5960
</div>

docs/src/components/homepage/Features.tsx

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -27,7 +27,7 @@ const Feature: FC<Props> = ({ icon, title, description, index }) => {
2727
>
2828
<div className="inline-flex gap-3 border-b pb-4 border-gray [&>*:first-child]:mt-1">
2929
{icon}
30-
<h6 className="text-2xl">{title}</h6>
30+
<span className="text-2xl">{title}</span>
3131
</div>
3232
<p>{description}</p>
3333
</motion.div>
@@ -38,8 +38,8 @@ const Features: FC = () => {
3838
return (
3939
<section className="component bg-white">
4040
<div className="pageContainer">
41-
<motion.h5
42-
className="text-base text-primary pb-14"
41+
<motion.h2
42+
className="text-base text-primary pb-14 section-label"
4343
initial="hidden"
4444
whileInView="visible"
4545
viewport={{ once: true }}
@@ -50,7 +50,7 @@ const Features: FC = () => {
5050
}}
5151
>
5252
/ FEATURES
53-
</motion.h5>
53+
</motion.h2>
5454
<motion.div className="grid laptop:grid-cols-3 laptop:grid-rows-2 laptop:grid-flow-row tablet:grid-rows-3 tablet:grid-flow-col gap-x-6 tablet:gap-y-6 laptop:gap-y-14 gap-y-14">
5555
{FeatureList.map((props, idx) => (
5656
<Feature key={idx} index={idx} {...props} />

docs/src/components/homepage/Properties.tsx

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -47,7 +47,7 @@ const Properties: FC = () => {
4747
}}
4848
>
4949
<div className="component pageContainer flex flex-col">
50-
<h5 className="text-base text-white">/ PROPERTIES</h5>
50+
<h3 className="text-base text-white section-label">/ PROPERTIES</h3>
5151
<div className="flex flex-col laptop:flex-row justify-between">
5252
<div className="pt-14 laptop:pr-14 flex flex-col gap-8">
5353
{PropertiesContent.map((props, idx) => (

docs/src/components/homepage/WhyHydraHead.tsx

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -21,9 +21,9 @@ const WhyHydraHead: FC = () => {
2121
>
2222
<div className="grid laptop:flex laptop:flex-row laptop:gap-6">
2323
<div className="flex flex-col basis-[41%] pt-4 order-2 laptop:-order-1 laptop:w-[472px] laptop:pt-0">
24-
<h4 className="text-2xl text-primary font-medium pb-4">
24+
<h3 className="text-2xl text-primary font-medium pb-4">
2525
{WhyHydraHeadContent.title}
26-
</h4>
26+
</h3>
2727
<p>{WhyHydraHeadContent.descriptionParagraphOne}</p>
2828

2929
<motion.div
@@ -58,6 +58,7 @@ const WhyHydraHead: FC = () => {
5858
<div className="hidden basis-[59%] -order-1 laptop:order-2 tablet:block">
5959
<img
6060
src="hydra-docs-landing-graphic.png"
61+
alt="Hydra Head blockchain flowchart"
6162
className="border-b border-solid border-primary laptop:border-none"
6263
/>
6364
</div>

docs/src/css/custom.css

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -104,6 +104,10 @@ h4 {
104104
font-family: "Lexend";
105105
}
106106

107+
.section-label {
108+
font-family: "Inter";
109+
}
110+
107111
h5,
108112
h6 {
109113
font-family: "Inter";

docs/src/theme/Navbar/Content/index.js

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -74,6 +74,7 @@ export default function NavbarContent() {
7474
target="_blank"
7575
rel="noopener noreferrer"
7676
className="hover:text-primary-light mx-3 py-1"
77+
aria-label="Github link"
7778
>
7879
<GithubSmall />
7980
</a>
@@ -82,6 +83,7 @@ export default function NavbarContent() {
8283
target="_blank"
8384
rel="noopener noreferrer"
8485
className="hover:text-primary-light mx-3 py-1"
86+
aria-label="Discord link"
8587
>
8688
<Discord />
8789
</a>

docs/src/theme/Navbar/MobileSidebar/PrimaryMenu/index.js

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -37,6 +37,7 @@ export default function NavbarMobilePrimaryMenu() {
3737
target="_blank"
3838
rel="noopener noreferrer"
3939
className="hover:text-primary-light mx-3 py-1 inline-flex gap-3"
40+
aria-label="Github link"
4041
>
4142
<GithubSmall /> Github
4243
</a>
@@ -45,6 +46,7 @@ export default function NavbarMobilePrimaryMenu() {
4546
target="_blank"
4647
rel="noopener noreferrer"
4748
className="hover:text-primary-light mx-3 py-1 inline-flex gap-3"
49+
aria-label="Discord link"
4850
>
4951
<Discord className="mt-1" /> Discord
5052
</a>

0 commit comments

Comments
 (0)