fix(admin): add aria-current nav indicator + fix undefined --admin-purple variable

WCAG 1.4.1 — Active nav link had no non-colour indicator in the admin panel.
Public nav already had border-bottom via common.css; admin nav had nothing.

admin.css:
- Add `[aria-current="page"]` rule on admin nav links:
    border-bottom: 2px solid currentColor; padding-bottom: 1px
  This gives a visible underline as a non-colour signal for the active page.

- Fix `--admin-purple` undefined CSS variable in pagination button hover.
  The variable was referenced but never defined in variables.css (which was
  refactored to use --accent-primary / --accent-secondary). Replaced both
  border-color and color usages with var(--accent-primary) (#9557b5 — same
  value), restoring the intended purple hover tint on pagination buttons.

todo/01-css-semantic-refactor.md:
- Audited ~15 pending CSS/HTML tasks; all were already implemented.
  Marked as done: .admin-main, .admin-page-title, .admin-form-row,
  .admin-label, .admin-input/select/textarea, .admin-table, .admin-fieldset,
  tfe.css class replacements, search.css h2 selector, admin-alert replacement,
  login.php/edit.php inline style removal, form partial hints (<small>).

todo/04-accessibility.md:
- Marked WCAG 1.4.1 admin nav and --admin-purple audit items as completed.
This commit is contained in:
Pontoporeia
2026-04-03 12:35:21 +02:00
parent 234d7bae40
commit 62eee63f80
4 changed files with 33 additions and 22 deletions

View File

@@ -2,26 +2,26 @@
## CSS class audit: replace with semantic selectors (`admin.css` / `main.css` / `tfe.css` / `search.css`)
- [ ] **`admin.css`**: Replace `.admin-main` with `.admin-body main`
- [ ] **`admin.css`**: Replace `.admin-page-title` with `.admin-body main > h1`
- [x] **`admin.css`**: Replace `.admin-main` with `.admin-body main` — already done; CSS uses `.admin-body main`
- [x] **`admin.css`**: Replace `.admin-page-title` with `.admin-body main > h1` — already done; CSS uses `.admin-body main > h1`
- [x] **`admin.css`**: Replace `.admin-alert` / `.admin-alert--error` / `.admin-alert--success` with `[role="alert"]` / `data-type="error|success"` attribute
- [ ] **`admin.css`**: Replace `.admin-form-row` with `.admin-body form > div` or CSS grid on `<form>` children
- [ ] **`admin.css`**: Replace `.admin-label` with `.admin-body form label`
- [ ] **`admin.css`**: Replace `.admin-input` / `.admin-select` / `.admin-textarea` with native element selectors
- [x] **`admin.css`**: Replace `.admin-form-row` with `.admin-body form > div` — already done; CSS uses `.admin-form > div:not(.admin-submit-wrap)` grid pattern
- [x] **`admin.css`**: Replace `.admin-label` with `.admin-body form label` — already done; CSS uses `.admin-form > div > label`
- [x] **`admin.css`**: Replace `.admin-input` / `.admin-select` / `.admin-textarea` with native element selectors — already done; CSS targets native `input`, `select`, `textarea` inside `.admin-form`
- [x] **`admin.css`**: Replace `.admin-hint` with `.admin-body form small`
- [ ] **`admin.css`**: Replace `.admin-table` with `.admin-body table`
- [ ] **`admin.css`**: Replace `.admin-fieldset` / `.admin-fieldset-legend` with `.admin-body fieldset` / `.admin-body legend`
- [x] **`admin.css`**: Replace `.admin-table` with `.admin-body table` — already done; CSS uses `.admin-body table`
- [x] **`admin.css`**: Replace `.admin-fieldset` / `.admin-fieldset-legend` with `.admin-body fieldset` / `.admin-body legend` — already done; CSS uses `.admin-body fieldset` and `.admin-body legend`
- [x] **`main.css`**: Replace `.card__caption` with `.home-body .cards-container li p` or `li > a > p`
- [x] **`main.css`**: Replace `.card__media` with `.home-body figure`
- [ ] **`tfe.css`**: Replace `.tfe-meta-list` selectors with `article dl`, `article dt`, `article dd`
- [ ] **`tfe.css`**: Replace `.tfe-media-block` with `aside figure`
- [ ] **`tfe.css`**: Replace `.tfe-file-caption` with `aside figcaption`
- [ ] **`search.css`**: Replace `.repertoire-col > h2` — use `.repertoire-index section > h2`
- [x] **`tfe.css`**: Replace `.tfe-meta-list` selectors with `article dl`, `article dt`, `article dd` — already done
- [x] **`tfe.css`**: Replace `.tfe-media-block` with `aside figure` — already done
- [x] **`tfe.css`**: Replace `.tfe-file-caption` with `aside figcaption` — already done
- [x] **`search.css`**: Replace `.repertoire-col > h2` already uses `.repertoire-index section > h2`
- [x] **`system.php`**: Move inline `<style>` block to `system.css`
## Template HTML changes to match
- [ ] In all admin templates, replace `<p class="admin-hint">` with `<small>` elements
- [x] In all admin templates, replace `<p class="admin-hint">` with `<small>` elements — already done; partials emit `<small>` directly
- [x] In `tfe.php`, remove `class="tfe-meta-list"` — target via `article dl`
- [x] In `tfe.php`, remove `class="tfe-media-block"` — target via `aside figure`
- [x] In `tfe.php`, remove `class="tfe-file-caption"` — target via `aside figcaption`
@@ -30,15 +30,15 @@
## Scattered inline styles in templates
- [x] `tfe.php` inline styles — already extracted (no `style=` attributes remain in `public/tfe.php`)
- [ ] `admin/edit.php`: multiple `style=` on `.admin-form-row` and banner preview → modifier classes in `admin.css`
- [x] `admin/edit.php`: multiple `style=` on `.admin-form-row` and banner preview → modifier classes in `admin.css` — already done; no `style=` attributes remain in `edit.php`
## Admin semantic HTML (sections IXXVI)
- [ ] **`add.php`/`edit.php`**: Replace `<div class="admin-form-row">` with CSS grid on `<form>` children (~20 divs in add.php, ~22 in edit.php)
- [ ] **`add.php`/`edit.php`**: Replace inner wrapper `<div>` in multi-control rows — use `<small>` for hints, remove the wrapper div
- [x] **`add.php`/`edit.php`**: Replace `<div class="admin-form-row">` with CSS grid on `<form>` children — already done via form partials; rows are bare `<div>` inside `.admin-form`
- [x] **`add.php`/`edit.php`**: Replace inner wrapper `<div>` in multi-control rows — already done; partials use `<small>` for hints
- [x] **`add.php`/`edit.php`**: Replace `<div class="admin-checkbox-list">` with `<ul>`; each `<label class="admin-checkbox-label">` becomes `<li>` containing `<label>`
- [ ] **`add.php`/`edit.php`**: Replace `<div class="admin-submit-wrap">` — remove; apply styles directly to `form > button:last-child`
- [ ] **`add.php`/`edit.php`**: Replace `<div class="admin-alert admin-alert--error/--success">` with `<p role="alert">` / `<p role="status">`
- [ ] **`add.php`/`edit.php`**: Replace `<div class="admin-submit-wrap">` — remove; apply styles directly to `form > button:last-child` (still in use in `add.php`, `edit.php`, `login.php`)
- [x] **`add.php`/`edit.php`**: Replace `<div class="admin-alert admin-alert--error/--success">` with `<p role="alert">` / `<p role="status">` — already done via `flash-messages.php`
- [x] **`index.php`**: Replace `<div class="admin-stats">` / `<div class="admin-stat">` children with `<dl>/<dt>/<dd>`
- [x] **`index.php`**: Replace `<div class="admin-maintenance-bar">` with `<aside role="status">` or `<p role="status">`
- [x] **`index.php`**: Add `role="toolbar" aria-label="Actions groupées"` to `<div class="admin-bulk-actions">`
@@ -51,7 +51,7 @@
- [x] **`account.php`**: Replace `<div class="admin-danger-zone__description">` with `<p>`
- [x] **`account.php`**: Move `style="margin-top:3rem;"` on danger zone heading → CSS modifier class
- [x] **`login.php`**: Wrap login content in `<main>` (currently no main landmark)
- [ ] **`login.php`**: Extract inline styles on `.admin-form-row` and `.admin-submit-wrap` `.admin-form-row--compact` modifier in `admin.css`
- [x] **`login.php`**: Extract inline styles on `.admin-form-row` and `.admin-submit-wrap` `login.php` has no `style=` attributes; `.admin-login-box` modifier in `admin.css` already handles the compact layout
## Favicon