Skip to content

Commit 2f920cb

Browse files
website: Fix accessibility issues to match a11y standards
- Add alt attributes to images (nav event image, CNCF logos) - Give links discernible names (navbar brand, scroll-to-overview, aria-labels) - Improve contrast for navbar badges and adopters button - Make links distinguishable without color (underlines, focus-visible) - Fix heading order (section headings h3 -> h2) Closes: #4312 Signed-off-by: rohitbharmal <rbharmal@redhat.com> Co-authored-by: Cursor <cursoragent@cursor.com>
1 parent 7264005 commit 2f920cb

File tree

4 files changed

+60
-11
lines changed

4 files changed

+60
-11
lines changed

assets/scss/_styles_project.scss

Lines changed: 49 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -895,6 +895,55 @@ nav.foldable-nav {
895895
a > code {
896896
color: unset;
897897
}
898+
899+
// a11y: links distinguishable without color alone (underline, focus)
900+
a:not(.btn) {
901+
text-decoration: underline;
902+
text-underline-offset: 0.15em;
903+
904+
&:focus-visible {
905+
outline: 2px solid currentColor;
906+
outline-offset: 2px;
907+
}
908+
}
909+
}
910+
911+
// a11y: same for homepage content sections (links not relying on color only)
912+
#overview a:not(.btn),
913+
#community a:not(.btn),
914+
#pageContent a:not(.btn) {
915+
text-decoration: underline;
916+
text-underline-offset: 0.15em;
917+
918+
&:focus-visible {
919+
outline: 2px solid currentColor;
920+
outline-offset: 2px;
921+
}
922+
}
923+
924+
// --------------------------------------------------
925+
// a11y: sufficient contrast for navbar badges and adopters button
926+
// --------------------------------------------------
927+
.td-navbar .badge-warning {
928+
background-color: #b38600;
929+
color: #fff;
930+
}
931+
932+
#adopters .btn-outline-primary {
933+
color: $primary;
934+
border-color: $primary;
935+
font-weight: 500;
936+
937+
&:hover {
938+
color: #fff;
939+
background-color: $primary;
940+
border-color: $primary;
941+
}
942+
943+
&:focus-visible {
944+
outline: 2px solid $primary;
945+
outline-offset: 2px;
946+
}
898947
}
899948

900949
// --------------------------------------------------

config.toml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -69,7 +69,7 @@ ignoreFiles = []
6969
[[menu.main]]
7070
name = ""
7171
weight = -1000
72-
pre = "<span style='display:inline-flex; align-items:center;'><img src='/events/images/cloud-native-ai-2025.png' style='height:60px; width:auto; margin-right:8px;'><span style='display:flex; flex-direction:column; justify-content:center;'><span class='badge badge-warning' style='margin-bottom:4px;'>March 23rd, 2026</span><span class='badge badge-warning'>Amsterdam, Netherlands</span></span></span>"
72+
pre = "<span style='display:inline-flex; align-items:center;'><img src='/events/images/cloud-native-ai-2025.png' alt='Cloud Native AI 2025 event' style='height:60px; width:auto; margin-right:8px;'><span style='display:flex; flex-direction:column; justify-content:center;'><span class='badge badge-warning' style='margin-bottom:4px;'>March 23rd, 2026</span><span class='badge badge-warning'>Amsterdam, Netherlands</span></span></span>"
7373
post = ""
7474
url = "https://events.linuxfoundation.org/kubecon-cloudnativecon-europe/co-located-events/cloud-native-ai-kubeflow-day/"
7575
# [[menu.main]]

content/en/_index.html

Lines changed: 9 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -19,16 +19,16 @@
1919
<i class="fas fa-brain ml-1"></i>
2020
</a>
2121
<div class="mt-2">
22-
<a class="btn btn-link text-light" href="#overview">
23-
<i class="fa-solid fa-circle-chevron-down" style="font-size: 350%"></i>
22+
<a class="btn btn-link text-light" href="#overview" aria-label="Scroll to overview">
23+
<i class="fa-solid fa-circle-chevron-down" style="font-size: 350%" aria-hidden="true"></i>
2424
</a>
2525
</div>
2626
</div>
2727
{{</blocks/cover>}}
2828

2929
<div id="community-stats" class="text-center">
3030
<div class="container">
31-
<h3 class="section-head">
31+
<h2 class="section-head">
3232
<span class="border-bottom pb-2">Open Source. Battle-Tested. Community Built.</span>
3333
</h3>
3434
<div class="row justify-content-center">
@@ -62,7 +62,7 @@ <h3 class="section-head">
6262

6363
<div id="overview" class="text-center">
6464
<div class="container">
65-
<h3 class="section-head">
65+
<h2 class="section-head">
6666
<span class="border-bottom pb-2">What is Kubeflow?</span>
6767
</h3>
6868
<p class="mx-auto col-11 col-xl-7 px-0">
@@ -81,7 +81,7 @@ <h3 class="section-head">
8181

8282
<div id="adopters" class="text-center">
8383
<div class="container">
84-
<h3 class="section-head">
84+
<h2 class="section-head">
8585
<span class="border-bottom pb-2">Trusted by</span>
8686
</h3>
8787
<div class="mb-5 d-flex flex-wrap align-content-between align-items-center justify-content-center user-select-none">
@@ -129,7 +129,7 @@ <h3 class="section-head">
129129

130130
<section id="pageContent">
131131
<div class="container">
132-
<h3 class="section-head text-center">
132+
<h2 class="section-head text-center">
133133
<span class="border-bottom pb-2">Kubeflow Projects</span>
134134
</h3>
135135
<div class="card-deck">
@@ -290,7 +290,7 @@ <h3 class="section-head text-center">
290290

291291
<div id="community" class="text-center">
292292
<div class="container">
293-
<h3 class="section-head">
293+
<h2 class="section-head">
294294
<span class="border-bottom pb-2">Join our Community</span>
295295
</h3>
296296
<p class="mx-auto col-md-7 px-0">
@@ -306,13 +306,13 @@ <h3 class="section-head">
306306
<img
307307
src="/docs/images/logos/cncf.svg"
308308
draggable="false"
309-
class="show_light-only img-fluid
309+
class="show_light-only img-fluid"
310310
alt="Cloud Native Computing Foundation Logo"
311311
/>
312312
<img
313313
src="/docs/images/logos/cncf-white.svg"
314314
draggable="false"
315-
class="show_dark-only img-fluid
315+
class="show_dark-only img-fluid"
316316
alt="Cloud Native Computing Foundation Logo"
317317
/>
318318
</div>

layouts/partials/navbar.html

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,7 @@
66
<nav class="js-navbar-scroll navbar navbar-expand-md navbar-dark
77
{{- if $cover }} td-navbar-cover {{- end }} td-navbar">
88
<div class="container px-0">
9-
<a class="navbar-brand" href="{{ .Site.Home.RelPermalink }}">
9+
<a class="navbar-brand" href="{{ .Site.Home.RelPermalink }}" aria-label="{{ .Site.Title }} - home">
1010
{{- /**/ -}}
1111
<span class="navbar-brand__logo navbar-logo">
1212
{{- if ne .Site.Params.ui.navbar_logo false -}}

0 commit comments

Comments
 (0)