Skip to content

Commit

Permalink
Fix Axe accessibility issues
Browse files Browse the repository at this point in the history
Add main landmarks to index pages
Use figure element as role="presentation" does not officially support labels
Remove role="region" as they should have a unique label
  • Loading branch information
mgriffin-scottlogic committed Jul 12, 2024
1 parent a1f5af8 commit e52765f
Show file tree
Hide file tree
Showing 4 changed files with 15 additions and 13 deletions.
4 changes: 2 additions & 2 deletions src/app/carbon-estimation/carbon-estimation.component.html
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@ <h2 class="tce-text-2xl">Estimations</h2>
</p>
</div>
</expansion-panel>
<div [attr.aria-label]="emissionAriaLabel" role="presentation" tabindex="0">
<figure [attr.aria-label]="emissionAriaLabel" tabindex="0">
<apx-chart
#chart
aria-hidden="true"
Expand All @@ -32,5 +32,5 @@ <h2 class="tce-text-2xl">Estimations</h2>
[states]="chartOptions.states"
[dataLabels]="chartOptions.dataLabels"
[tooltip]="chartOptions.tooltip"></apx-chart>
</div>
</figure>
</div>
2 changes: 1 addition & 1 deletion src/app/expansion-panel/expansion-panel.component.html
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,6 @@
{{ expanded ? 'expand_less' : 'expand_more' }}
</button>
</div>
<div [ngClass]="{ 'tce-hidden': !expanded }" [class]="config.contentContainerStyles" role="region">
<div [ngClass]="{ 'tce-hidden': !expanded }" [class]="config.contentContainerStyles">
<ng-content select="[content]"></ng-content>
</div>
10 changes: 5 additions & 5 deletions src/index.html
Original file line number Diff line number Diff line change
Expand Up @@ -10,11 +10,11 @@
<link href="https://use.typekit.net/fjg7yrm.css" rel="stylesheet" />
</head>
<body>
<noscript
>Javascript appears to be disabled - unfortunately the estimator requires it to be enabled to function.</noscript
>
<div class="tce-pt-4 md:tce-pb-4">
<main class="tce-pt-4 md:tce-pb-4">
<noscript
>Javascript appears to be disabled - unfortunately the estimator requires it to be enabled to function.</noscript
>
<tech-carbon-estimator></tech-carbon-estimator>
</div>
</main>
</body>
</html>
12 changes: 7 additions & 5 deletions src/package-index.html
Original file line number Diff line number Diff line change
Expand Up @@ -8,10 +8,12 @@
<link href="https://fonts.googleapis.com/icon?family=Material+Icons+Outlined" rel="stylesheet" />
</head>
<body class="tce-m-0 dark:tce-bg-slate-800 dark:tce-text-slate-50">
<noscript
>Javascript appears to be disabled - unfortunately the estimator requires it to be enabled to function.</noscript
>
<tech-carbon-estimator></tech-carbon-estimator>
<footer class="tce-p-5 tce-bg-slate-800 tce-text-slate-50 dark:tce-bg-slate-950">© Copyright Scott Logic</footer>
<main>
<noscript
>Javascript appears to be disabled - unfortunately the estimator requires it to be enabled to function.</noscript
>
<tech-carbon-estimator></tech-carbon-estimator>
<footer class="tce-p-5 tce-bg-slate-800 tce-text-slate-50 dark:tce-bg-slate-950">© Copyright Scott Logic</footer>
</main>
</body>
</html>

0 comments on commit e52765f

Please sign in to comment.