Skip to content

Commit 84a39be

Browse files
committed
Improve accessibility and touch target size across views and styles
- Updated links in `back-login.blade.php` and `register.blade.php` to include `a11y-target-link` class for better accessibility. - Adjusted styles in `_tables.scss` and `_cards.scss` to ensure minimum clickable area meets touch target requirements. - Enhanced `SiteAssetPresenter` links with `site-asset-link` class for improved accessibility and consistency.
1 parent 5c3dcc3 commit 84a39be

6 files changed

Lines changed: 52 additions & 24 deletions

File tree

app/Presenters/SiteAssetPresenter.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -40,7 +40,7 @@ public function assetUrl()
4040
$filename = basename($this->model->download_path);
4141
$ariaLabel = e(t('Open file: %s (site asset %s; opens in a new tab)', (string) $filename, (string) $this->model->id));
4242

43-
return '<a href="'.$url.'" target="_blank" rel="noopener noreferrer" aria-label="'.$ariaLabel.'"><i class="fas fa-file" aria-hidden="true"></i> '.e((string) $filename).'</a>';
43+
return '<a href="'.$url.'" target="_blank" rel="noopener noreferrer" class="site-asset-link" aria-label="'.$ariaLabel.'"><i class="fas fa-file" aria-hidden="true"></i> '.e((string) $filename).'</a>';
4444
}
4545

4646
return '';

resources/css/components/_cards.scss

Lines changed: 10 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -49,14 +49,9 @@
4949
list-style-type: none;
5050
-webkit-margin-before: 0;
5151
-webkit-margin-after: 0;
52-
-webkit-margin-start: 0px;
53-
-webkit-margin-end: 0px;
54-
-webkit-padding-start: 0px;
55-
margin-before: 0;
56-
margin-after: 0;
57-
margin-start: 0px;
58-
margin-end: 0px;
59-
padding-start: 0px;
52+
-webkit-margin-start: 0;
53+
-webkit-margin-end: 0;
54+
-webkit-padding-start: 0;
6055
}
6156

6257
.card ul.text li {
@@ -164,6 +159,13 @@
164159
box-shadow: none;
165160
}
166161

162+
.card-footer .site-asset-link {
163+
display: inline-flex;
164+
align-items: center;
165+
min-width: 44px;
166+
min-height: 44px;
167+
}
168+
167169
.project-banner {
168170
position: relative;
169171
cursor: pointer;

resources/css/components/_tables.scss

Lines changed: 31 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -6,28 +6,27 @@
66
font-size: .8rem;
77
}
88

9-
/* Global: improve Bootstrap/DataTables pagination contrast (Axe color-contrast) */
9+
/* Global: improve Bootstrap/DataTables pagination contrast */
1010
.page-link {
11-
color: $brand-red; /* was #0056b3 */
11+
color: $brand-red;
1212
}
1313

1414
.page-link:hover,
1515
.page-link:focus {
16-
color: darken($brand-red, 8%); /* was #003d80 */
16+
color: darken($brand-red, 8%);
1717
}
1818

1919
.page-item.active .page-link {
20-
background-color: $brand-red; /* was #0056b3 */
21-
border-color: $brand-red; /* was #0056b3 */
20+
background-color: $brand-red;
21+
border-color: $brand-red;
2222
color: #ffffff;
2323
}
2424

25-
/* Optional: make DataTables table links use brand color too (this is what Axe is flagging on Group show) */
25+
/* DataTables table links */
2626
table.dataTable tbody a {
2727
color: $brand-red;
2828
}
2929

30-
/* A11y: striped rows are gray; darken link color there to meet WCAG AA for small text */
3130
table.dataTable.table-striped tbody tr:nth-of-type(odd) a {
3231
color: darken($brand-red, 14%);
3332
}
@@ -38,11 +37,7 @@ table.dataTable tbody a:focus {
3837
text-decoration: underline;
3938
}
4039

41-
/**
42-
* ADA: DataTables "Search" inputs need sufficient contrast.
43-
* DataTables creates: .dataTables_wrapper .dataTables_filter input[type="search"]
44-
* Keep this scoped to DataTables so we don't affect every input site-wide.
45-
*/
40+
/* DataTables search input */
4641
.dataTables_wrapper {
4742
.dataTables_filter {
4843
input[type="search"] {
@@ -52,7 +47,7 @@ table.dataTable tbody a:focus {
5247

5348
&::placeholder {
5449
color: #6c757d;
55-
opacity: 1; // ensure consistent placeholder contrast across browsers
50+
opacity: 1;
5651
}
5752

5853
&:focus {
@@ -63,3 +58,26 @@ table.dataTable tbody a:focus {
6358
}
6459
}
6560
}
61+
62+
/* DataTables pagination target size */
63+
.dataTables_wrapper .dataTables_paginate .pagination .page-item:not(.previous):not(.next) {
64+
width: 44px;
65+
height: 44px;
66+
}
67+
68+
.dataTables_wrapper .dataTables_paginate .pagination .page-item .page-link {
69+
display: flex !important;
70+
align-items: center;
71+
justify-content: center;
72+
box-sizing: border-box;
73+
width: 100%;
74+
height: 44px !important;
75+
min-width: 44px !important;
76+
padding: 0 12px !important;
77+
line-height: 1 !important;
78+
}
79+
80+
.dataTables_wrapper .dataTables_paginate .pagination .page-item.previous .page-link,
81+
.dataTables_wrapper .dataTables_paginate .pagination .page-item.next .page-link {
82+
min-width: 44px !important;
83+
}

resources/css/components/_utilities.scss

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -127,3 +127,11 @@
127127
color: #7e8ea1;
128128
cursor: help;
129129
}
130+
131+
.a11y-target-link {
132+
display: inline-flex;
133+
align-items: center;
134+
justify-content: center;
135+
min-width: 44px;
136+
min-height: 44px;
137+
}

resources/views/auth/register.blade.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -79,7 +79,7 @@ class="form-horizontal">
7979
@include('common.submit-button')
8080
</form>
8181
<div class="mt-4 text-center">
82-
<a href="{{ route('app.get.login') }}">{{ t('Already have an account? Login') }}</a>
82+
<a href="{{ route('app.get.login') }}" class="a11y-target-link">{{ t('Already have an account? Login') }}</a>
8383
</div>
8484
</div>
8585
</div>
Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,3 @@
11
<div class="mt-4 text-center">
2-
<a href="{{ $route }}">{{ t('Back to Login') }}</a>
2+
<a href="{{ $route }}" class="a11y-target-link">{{ t('Back to Login') }}</a>
33
</div>

0 commit comments

Comments
 (0)