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

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:
Alexander Whitestone
2026-04-13 22:12:18 -04:00
parent 6b08d129b7
commit 4e3be0f113
3 changed files with 91 additions and 0 deletions

View 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}}

View 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}}