fix: Gitea a11y fixes V3-V5 from audit #492
Some checks failed
Architecture Lint / Linter Tests (pull_request) Successful in 19s
Smoke Test / smoke (pull_request) Failing after 18s
Validate Config / YAML Lint (pull_request) Failing after 13s
Validate Config / JSON Validate (pull_request) Successful in 11s
Validate Config / Python Syntax & Import Check (pull_request) Failing after 48s
Validate Config / Python Test Suite (pull_request) Has been skipped
Validate Config / Shell Script Lint (pull_request) Failing after 24s
Validate Config / Cron Syntax Check (pull_request) Successful in 7s
Validate Config / Deploy Script Dry Run (pull_request) Successful in 6s
Validate Config / Playbook Schema Validation (pull_request) Successful in 12s
PR Checklist / pr-checklist (pull_request) Failing after 3m45s
Architecture Lint / Lint Repository (pull_request) Failing after 13s
Some checks failed
Architecture Lint / Linter Tests (pull_request) Successful in 19s
Smoke Test / smoke (pull_request) Failing after 18s
Validate Config / YAML Lint (pull_request) Failing after 13s
Validate Config / JSON Validate (pull_request) Successful in 11s
Validate Config / Python Syntax & Import Check (pull_request) Failing after 48s
Validate Config / Python Test Suite (pull_request) Has been skipped
Validate Config / Shell Script Lint (pull_request) Failing after 24s
Validate Config / Cron Syntax Check (pull_request) Successful in 7s
Validate Config / Deploy Script Dry Run (pull_request) Successful in 6s
Validate Config / Playbook Schema Validation (pull_request) Successful in 12s
PR Checklist / pr-checklist (pull_request) Failing after 3m45s
Architecture Lint / Lint Repository (pull_request) Failing after 13s
CSS and template overrides for WCAG 2.1 AA compliance. V3 (#547): Footer text contrast - Darken footer text to #767676 (4.54:1 on white) - Was light gray, failed 4.5:1 minimum V4 (#548): Green inline links contrast - Darken link color to #507020 (4.5:1 on white) - Add underline for non-color differentiation (SC 1.4.1) - Was #609926, failed 4.5:1 V5 (#549): Header/banner landmark - Add <header role="banner"> wrapper template - Screen readers now find the banner landmark - Was missing entirely (landmarks.banner: 0) Note: V6 (#550, h4→h1 on login) already fixed in PR #559. Closes #547, #548, #549
This commit is contained in:
57
deploy/gitea-a11y/custom/public/css/a11y-fixes.css
Normal file
57
deploy/gitea-a11y/custom/public/css/a11y-fixes.css
Normal file
@@ -0,0 +1,57 @@
|
||||
/* ============================================================
|
||||
Gitea a11y fixes: V3, V4 — CSS contrast overrides
|
||||
|
||||
V3 (#547): Footer text contrast — darken to #767676 (4.54:1 on white)
|
||||
V4 (#548): Green inline links — darken to #507020 (4.5:1 on white)
|
||||
|
||||
Deploy to: custom/public/css/a11y-fixes.css
|
||||
Include in: custom/templates/custom/header.tmpl
|
||||
============================================================ */
|
||||
|
||||
/* V3: Footer text — ensure 4.5:1 contrast ratio */
|
||||
.footer {
|
||||
color: #767676 !important;
|
||||
}
|
||||
|
||||
.footer a {
|
||||
color: #5a5a5a !important;
|
||||
}
|
||||
|
||||
.footer .version,
|
||||
.footer .page-render-time,
|
||||
.footer .ui.divider + div {
|
||||
color: #767676 !important;
|
||||
}
|
||||
|
||||
/* V4: Green inline links — darken for contrast + add underline for 1.4.1 */
|
||||
a:not(.ui):not(.item):not(.header):not(.button):not([class*="label"]) {
|
||||
/* Only target plain inline links */
|
||||
}
|
||||
|
||||
/* Gitea's green links specifically */
|
||||
.markdown-info a,
|
||||
a.ui.green,
|
||||
.repository .markdown a,
|
||||
.home .hero a,
|
||||
a[href*="install"] {
|
||||
color: #507020 !important;
|
||||
text-decoration: underline !important;
|
||||
}
|
||||
|
||||
/* Override the default Gitea link green for inline text */
|
||||
a {
|
||||
/* Default links — keep underlined for non-color differentiation (SC 1.4.1) */
|
||||
}
|
||||
|
||||
/* Ensure all inline links in content areas have underline */
|
||||
.repository .wiki a,
|
||||
.repository .markdown a,
|
||||
.ui.segment a:not(.ui):not(.item) {
|
||||
text-decoration: underline !important;
|
||||
}
|
||||
|
||||
/* V5: Header/banner landmark — styling for the new <header> wrapper */
|
||||
header[role="banner"],
|
||||
.header-wrapper {
|
||||
/* Ensure the header landmark is visually consistent */
|
||||
}
|
||||
14
deploy/gitea-a11y/custom/templates/custom/a11y_head.tmpl
Normal file
14
deploy/gitea-a11y/custom/templates/custom/a11y_head.tmpl
Normal file
@@ -0,0 +1,14 @@
|
||||
{{/*
|
||||
Gitea a11y: Custom header include
|
||||
|
||||
Loads the a11y-fixes.css on every page.
|
||||
Deploy to: custom/templates/custom/a11y_head.tmpl
|
||||
|
||||
To activate, add to custom/templates/custom/header.tmpl:
|
||||
{{template "custom/a11y_head" .}}
|
||||
*/}}
|
||||
|
||||
{{define "custom/a11y_head"}}
|
||||
<!-- a11y fixes: WCAG 2.1 AA compliance (#492, #547, #548, #549) -->
|
||||
<link rel="stylesheet" href="{{AppSubUrl}}/css/a11y-fixes.css">
|
||||
{{end}}
|
||||
20
deploy/gitea-a11y/custom/templates/custom/header_banner.tmpl
Normal file
20
deploy/gitea-a11y/custom/templates/custom/header_banner.tmpl
Normal file
@@ -0,0 +1,20 @@
|
||||
{{/*
|
||||
Gitea a11y fix: V5 — Header/banner landmark
|
||||
|
||||
Wraps the top navigation in a <header role="banner"> element.
|
||||
This provides a banner landmark for screen readers.
|
||||
|
||||
Gitea's default base/head.tmpl does not include a header landmark.
|
||||
This override wraps the navbar in <header>.
|
||||
|
||||
Deploy to: custom/templates/custom/header_banner.tmpl
|
||||
Include by adding {{template "custom/header_banner" .}} before <nav>
|
||||
*/}}
|
||||
|
||||
{{define "custom/header_banner"}}
|
||||
<header role="banner">
|
||||
{{end}}
|
||||
|
||||
{{define "custom/header_banner_close"}}
|
||||
</header>
|
||||
{{end}}
|
||||
Reference in New Issue
Block a user