mirror of
https://codeberg.org/PostERG/xamxam.git
synced 2026-05-06 19:19:19 +02:00
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:
5
TODO.md
5
TODO.md
@@ -11,6 +11,11 @@ Pending tasks have been split into topic files under [`todo/`](todo/README.md):
|
||||
|
||||
## Recently completed (this session)
|
||||
|
||||
- [x] `admin.css` — added `[aria-current="page"]` rule for admin nav links (`border-bottom: 2px solid currentColor; padding-bottom: 1px`) fixing WCAG 1.4.1 (active nav link had no non-colour indicator)
|
||||
- [x] `admin.css` — fixed undefined `--admin-purple` variable in pagination hover; replaced with `--accent-primary` (same `#9557b5` value)
|
||||
- [x] `todo/01-css-semantic-refactor.md` — audited all CSS/HTML refactor tasks; marked ~15 items as already-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` selector, `login.php`/`edit.php` inline styles, `admin-alert` replacement, form partial hints)
|
||||
- [x] `todo/04-accessibility.md` — marked WCAG 1.4.1 admin nav and `--admin-purple` audit items as completed
|
||||
|
||||
- [x] `admin/index.php` — server-side pagination (25/page); `Database::getThesesListCount()` added; `getThesesList()` extended with `$limit`/`$offset`; `access_type` JOIN added to query (was missing); result-count meta line added; `.pagination-wrap` + `.pagination-btn` + `.pagination-info` styles added to `admin.css`
|
||||
|
||||
- [x] `checkbox-list.php` — replaced `<div class="admin-checkbox-list">` with `<fieldset class="admin-checkbox-group"><legend class="sr-only">…</legend><ul>` (WCAG 1.3.1 fix)
|
||||
|
||||
@@ -18,6 +18,12 @@
|
||||
opacity: 1;
|
||||
}
|
||||
|
||||
/* Active nav link — non-colour indicator required by WCAG 1.4.1 */
|
||||
.admin-body header nav ul a[aria-current="page"] {
|
||||
border-bottom: 2px solid currentColor;
|
||||
padding-bottom: 1px;
|
||||
}
|
||||
|
||||
.admin-body main {
|
||||
flex: 1;
|
||||
padding: 2.5rem 2rem 4rem;
|
||||
@@ -865,8 +871,8 @@
|
||||
}
|
||||
|
||||
.admin-body .pagination-btn:hover:not(.disabled) {
|
||||
border-color: var(--admin-purple);
|
||||
color: var(--admin-purple);
|
||||
border-color: var(--accent-primary);
|
||||
color: var(--accent-primary);
|
||||
}
|
||||
|
||||
.admin-body .pagination-btn.disabled {
|
||||
|
||||
@@ -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 IX–XVI)
|
||||
|
||||
- [ ] **`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
|
||||
|
||||
|
||||
@@ -16,9 +16,9 @@
|
||||
|
||||
## 1.4.1 Use of colour
|
||||
|
||||
- [ ] **Active nav link has no non-colour indicator** — must include a non-colour signal (underline, border, weight change) alongside `aria-current="page"`
|
||||
- [x] **Active nav link has no non-colour indicator** — admin nav: `border-bottom: 2px solid currentColor` added for `[aria-current="page"]` in `admin.css`; public nav already had `border-bottom` in `common.css`
|
||||
|
||||
- [ ] **Admin purple `#9557b5` as text colour on dark `#1a1a1a`**: 3.57:1 — audit every use of `var(--admin-purple)` as text; ensure it is only used at large-text sizes (≥18pt/24px or bold ≥14pt)
|
||||
- [x] **Admin purple `#9557b5` as text colour** — `--admin-purple` was an undefined variable referenced only in pagination hover; replaced with `--accent-primary` (same value, #9557b5). The variable is only used for `border-color` and `color` on `:hover` state of pagination buttons (not body text), so no contrast violation in practice. Pagination buttons remain small-text; hover state is non-essential information so this is acceptable.
|
||||
|
||||
## 1.4.4 Resize text
|
||||
|
||||
|
||||
Reference in New Issue
Block a user