Skip to content

Commit 03b42cf

Browse files
13 links rely on color to be distinguishable on item view page (ufal#79)
* Improve link accessibility on item pages Adds underline and focus styles to links in full and simple item pages to meet WCAG 1.4.1 requirements, ensuring links are distinguishable by more than color alone and have visible focus outlines. * Exclude icon links from underline accessibility styles Updated SCSS selectors to prevent Font Awesome icon links (.fab, .fas, .far) from receiving underline styles intended for accessible text links, ensuring visual consistency and improved accessibility compliance. * Update link styles for accessibility compliance Replaces underline styles with bold and italic for non-button links in full and simple item page components to ensure links are distinguishable by more than color alone, addressing WCAG 1.4.1 requirements. * Use $primary variable for link focus outline color Replaces hardcoded #1459c4 color with the $primary SCSS variable for link focus outlines in both full and simple item page components to improve theme consistency. * Exclude more classes from link styling in full item page Added .badge, .nav-link, and .dropdown-item to the list of excluded classes for custom link styles to prevent unintended styling on these elements and improve WCAG compliance. * Remove unnecessary !important from link styles Cleaned up SCSS for full and simple item pages by removing redundant !important flags from link styling rules, improving maintainability and specificity.
1 parent 82eb62a commit 03b42cf

File tree

2 files changed

+32
-0
lines changed

2 files changed

+32
-0
lines changed

src/app/item-page/full/full-item-page.component.scss

Lines changed: 16 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -14,3 +14,19 @@
1414
max-width: none;
1515
}
1616
}
17+
18+
// WCAG 1.4.1: Links must be distinguishable by more than color alone
19+
.full-item-info ::ng-deep a:not(.btn):not(.fab):not(.fas):not(.far):not(.badge):not(.nav-link):not(.dropdown-item) {
20+
font-weight: 600;
21+
font-style: italic;
22+
}
23+
24+
.full-item-info ::ng-deep a:not(.btn):not(.fab):not(.fas):not(.far):not(.badge):not(.nav-link):not(.dropdown-item):hover,
25+
.full-item-info ::ng-deep a:not(.btn):not(.fab):not(.fas):not(.far):not(.badge):not(.nav-link):not(.dropdown-item):focus {
26+
text-decoration-thickness: 0.08em;
27+
}
28+
29+
.full-item-info ::ng-deep a:focus-visible {
30+
outline: 2px solid #{$primary};
31+
outline-offset: 2px;
32+
}

src/app/item-page/simple/item-page.component.scss

Lines changed: 16 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -43,3 +43,19 @@ pre {
4343
border-radius: 4px;
4444
white-space: pre-wrap;
4545
}
46+
47+
// WCAG 1.4.1: Links must be distinguishable by more than color alone
48+
.item-page ::ng-deep a:not(.btn):not(.badge):not(.nav-link):not(.dropdown-item):not(.fab):not(.fas):not(.far) {
49+
font-weight: 600;
50+
font-style: italic;
51+
}
52+
53+
.item-page ::ng-deep a:not(.btn):not(.badge):not(.nav-link):not(.dropdown-item):not(.fab):not(.fas):not(.far):hover,
54+
.item-page ::ng-deep a:not(.btn):not(.badge):not(.nav-link):not(.dropdown-item):not(.fab):not(.fas):not(.far):focus {
55+
text-decoration-thickness: 0.08em;
56+
}
57+
58+
.item-page ::ng-deep a:focus-visible {
59+
outline: 2px solid #{$primary};
60+
outline-offset: 2px;
61+
}

0 commit comments

Comments
 (0)