Skip to content

Commit 33e9e1e

Browse files
authored
Merge pull request #155 from devgeniem/TMS-931
TMS-931: General accessibility fixes
2 parents 76881e7 + 336d07b commit 33e9e1e

24 files changed

+393
-327
lines changed

CHANGELOG.MD

Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -7,6 +7,17 @@ and this project adheres to [Semantic Versioning](http://semver.org/spec/v2.0.0.
77

88
## [Unreleased]
99

10+
## [1.8.4] - 2023-05-24
11+
12+
## Fixed
13+
14+
- TMS-931: Change back-to-top button to focus main-content
15+
- TMS-931: Add screen-reader info for links that go to external sites
16+
- TMS-931: Remove entry__content containers display: grid and add a max-width & centering margins to prevent overflow with zoomed in browsers
17+
- TMS-931: Navigation accessibility fixes
18+
- TMS-931: Program search accessibility fixes for zoomed in browsers
19+
- TMS-931: Added description-list element to single programs info-component
20+
1021
## [1.8.3] - 2023-05-02
1122

1223
## Fixed

assets/scripts/back-to-top.js

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -23,6 +23,11 @@ export default class BackToTop {
2323
$( 'html, body' ).animate( {
2424
scrollTop: 0,
2525
}, 200 );
26+
27+
// Clear the current hash if the user has used 'skip to content' button
28+
window.location.hash = '';
29+
// Add main-content as the location hash
30+
window.location.hash = '#main-content';
2631
}
2732

2833
/**

assets/scripts/external-links.js

Lines changed: 17 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -22,6 +22,13 @@ export default class ExternalLinks {
2222
const domain = window.location.hostname;
2323
const icon = Common.makeIcon( 'external', 'icon--medium ml-1' );
2424

25+
// Translations are defined in models/strings.php,
26+
// and loaded to windows.s in lib/Assets.php.
27+
const translations = window.s.common || {
28+
target_blank: 'Opens in a new window',
29+
external_link: 'The link takes you to an external website',
30+
};
31+
2532
// Links in regular context
2633
$( '#main-content a[href*="//"]:not(.button, .logo-wall__link, .link-list a, [href*="' + domain + '"])' ).append( icon ); // eslint-disable-line
2734

@@ -46,13 +53,17 @@ export default class ExternalLinks {
4653
$( this ).children( '.icon' ).attr( 'aria-hidden', 'true' );
4754
} );
4855

49-
// Translations are defined in models/strings.php,
50-
// and loaded to windows.s in lib/Assets.php.
51-
const translations = window.s.common || {
52-
target_blank: 'Opens in a new window',
53-
};
56+
// Add screen reader text that informs if the link is an external website
57+
$( '#main-content a[href*="//"]:not([href*="' + domain + '"])' ).append( `<span class="is-sr-only external-info">(${ translations.external_link })</span>` ); // eslint-disable-line
5458

5559
// Add instructional text for screen readers on links which open a new window/tab
56-
$( 'a[target="_blank"]' ).append( `<span class="is-sr-only">(${ translations.target_blank })</span>` );
60+
if ( $( 'a[target="_blank"]' ).children( '.external-info' ).length > 0 ) {
61+
// Append the info with external link info
62+
$( 'a[target="_blank"] .external-info' ).append( `(${ translations.target_blank })</span>` );
63+
}
64+
else {
65+
// Append info to the link as its own element
66+
$( 'a[target="_blank"]' ).append( `<span class="is-sr-only">(${ translations.target_blank })</span>` );
67+
}
5768
}
5869
}

assets/styles/ui-components/_entry.scss

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,10 @@
11
.entry {
2+
&__content {
3+
max-width: 58.5rem;
4+
margin-left: auto;
5+
margin-right: auto;
6+
}
7+
28
&__content,
39
.topical-content .field-body {
410
> p {

assets/styles/ui-components/header/_primary-nav.scss

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -12,6 +12,7 @@ $navbar-item-dropdown-accent-color: $primary !default;
1212
font-family: $family-secondary;
1313
display: flex;
1414
justify-content: center;
15+
flex-wrap: wrap;
1516

1617
.navbar-item {
1718
padding: $theme-spacing-three-quarters 0;
@@ -116,6 +117,8 @@ $navbar-item-dropdown-accent-color: $primary !default;
116117
grid-template-columns: 1fr 1fr 1fr 1fr;
117118
grid-column-gap: $gap;
118119
text-transform: none;
120+
list-style: none;
121+
padding-left: 0;
119122

120123
.navbar-item {
121124
padding: 1.411rem 0;

assets/styles/ui-components/header/_secondary-nav.scss

Lines changed: 6 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -8,17 +8,14 @@ $secondary-navbar-item-font-weight: 600 !default;
88

99
.secondary-menu {
1010
font-size: .9em;
11+
flex-wrap: wrap;
1112

12-
li {
13-
&:not(:first-child) {
14-
@include from($desktop) {
15-
margin-left: .5rem;
16-
}
13+
@include from($desktop) {
14+
gap: .5rem;
15+
}
1716

18-
@include from($fullhd) {
19-
margin-left: 1rem;
20-
}
21-
}
17+
@include from($fullhd) {
18+
gap: 1rem;
2219
}
2320

2421
a {

assets/styles/views/_page-program.scss

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -16,6 +16,12 @@
1616
grid-template-columns: 1fr 1fr;
1717
}
1818

19+
&__item {
20+
.info-column {
21+
max-width: 100%;
22+
}
23+
}
24+
1925
a {
2026
&:focus {
2127
@extend .button-state-focus;

lang/fi.mo

246 Bytes
Binary file not shown.

0 commit comments

Comments
 (0)