Skip to content

Commit 7d99b3c

Browse files
Merge pull request #4140 from OpenLiberty/Website_accessibility_fix
Website accessibility fix
2 parents 8f5ceed + 9ef7212 commit 7d99b3c

File tree

3 files changed

+27
-7
lines changed

3 files changed

+27
-7
lines changed

src/main/content/_assets/css/coderay-custom.css

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -129,7 +129,7 @@ table.CodeRay td { padding: 2px 4px; vertical-align: top; }
129129
.CodeRay .predefined-type { color:#566D17; font-weight:500 }
130130
.CodeRay .preprocessor { color:#517394 }
131131
.CodeRay .pseudo-class { color:#00C; font-weight:500 }
132-
.CodeRay .reserved { color:#080; font-weight:500 }
132+
.CodeRay .reserved { color:#006600; font-weight:500 }
133133
.CodeRay .shell { background-color:hsla(120,100%,50%,0.06); }
134134
.CodeRay .shell .content { color:#2B2 }
135135
.CodeRay .shell .delimiter { color:#161 }
@@ -147,7 +147,7 @@ table.CodeRay td { padding: 2px 4px; vertical-align: top; }
147147
.CodeRay .symbol .delimiter { color:#740 }
148148
.CodeRay .tag { color:#070; font-weight:500 }
149149
.CodeRay .type { color:#332C9A; font-weight:500 }
150-
.CodeRay .value { color: #088 }
150+
.CodeRay .value { color: #006666 }
151151
.CodeRay .variable { color:#037 }
152152

153153
.CodeRay .insert { background: hsla(120,100%,50%,0.12) }

src/main/content/_assets/css/post.scss

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -152,11 +152,11 @@ body {
152152

153153
#article_body a{
154154
font-weight: 500;
155-
color: #546FB5;
155+
color: #0d47a1;
156156
transition: color .2s;
157157

158158
&:hover {
159-
color: #6787D9;
159+
color: #0d47a1;
160160
}
161161
}
162162
#article_body a.external {

src/main/content/_layouts/default.html

Lines changed: 23 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -25,15 +25,35 @@
2525
</body>
2626
<script>
2727
document.addEventListener('DOMContentLoaded', () => {
28+
2829
document.querySelectorAll('pre[tabindex="0"]').forEach(el => el.removeAttribute('tabindex'));
30+
31+
// Fix IBM consent banner role - it's injected by ibm-common.js with role="banner"
32+
// Use MutationObserver to catch it when it's added to the DOM
33+
const observer = new MutationObserver((mutations) => {
34+
const consentBar = document.getElementById('consent_blackbar');
35+
if (consentBar && consentBar.getAttribute('role') === 'banner') {
36+
consentBar.setAttribute('role', 'complementary');
37+
consentBar.setAttribute('aria-label', 'Cookie consent');
38+
observer.disconnect(); // Stop observing once fixed
39+
}
40+
});
41+
42+
// Start observing the document body for added nodes
43+
observer.observe(document.body, { childList: true, subtree: true });
44+
2945
});
3046
</script>
3147
<script>
3248
document.addEventListener('DOMContentLoaded', function() {
33-
const tables = document.querySelectorAll('.admonitionblock table, .colist table');
34-
tables.forEach(table => {
49+
// Fix accessibility for ALL tables without headers
50+
const allTables = document.querySelectorAll('table');
51+
allTables.forEach(table => {
3552
if (!table.hasAttribute('role')) {
36-
table.setAttribute('role', 'none');
53+
const hasHeaders = table.querySelector('th');
54+
if (!hasHeaders) {
55+
table.setAttribute('role', 'presentation');
56+
}
3757
}
3858
});
3959
});

0 commit comments

Comments
 (0)