From e9e012376de5d8e5e19dce8236fdce8b2e44e200 Mon Sep 17 00:00:00 2001 From: Pontoporeia Date: Thu, 2 Apr 2026 12:35:23 +0200 Subject: [PATCH] Replace .admin-alert BEM classes with semantic role/data-type attributes MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit - admin.css: replace .admin-alert / .admin-alert--error / .admin-alert--success selectors with [role="alert"][data-type="error"] and [role="status"][data-type="success"] - All 10 admin templates updated:
becomes

(or

for the import.php multi-item list that contains a
    ) - flash-messages.php partial updated to match - WCAG benefit: role="alert" is an ARIA live region — errors are announced immediately by screen readers without focus movement (fixes WCAG 3.3.1, 4.1.2) - role="status" (polite live region) used for success messages — announced without interrupting the user - Removes two BEM modifier classes; CSS now targets element semantics directly --- TODO.md | 2 +- public/admin/account.php | 4 ++-- public/admin/add.php | 2 +- public/admin/edit.php | 4 ++-- public/admin/import.php | 4 ++-- public/admin/index.php | 4 ++-- public/admin/login.php | 2 +- public/admin/pages.php | 2 +- public/admin/tags.php | 4 ++-- public/admin/thanks.php | 2 +- public/assets/css/admin.css | 7 ++++--- templates/partials/flash-messages.php | 4 ++-- 12 files changed, 21 insertions(+), 20 deletions(-) diff --git a/TODO.md b/TODO.md index 1b809be..c93291c 100644 --- a/TODO.md +++ b/TODO.md @@ -5,7 +5,7 @@ ### CSS class audit: replace with semantic selectors - [x] **`admin.css`**: Replace `.admin-main` with `.admin-body main` — only one `
    ` per page - [x] **`admin.css`**: Replace `.admin-page-title` with `.admin-body main > h1` — always the first `h1` in `
    ` -- [ ] **`admin.css`**: Replace `.admin-alert` / `.admin-alert--error` / `.admin-alert--success` with `[role="alert"]` or `.admin-body main > .alert` using `data-type="error|success"` attribute instead of modifier classes +- [x] **`admin.css`**: Replace `.admin-alert` / `.admin-alert--error` / `.admin-alert--success` with `[role="alert"]` or `.admin-body main > .alert` using `data-type="error|success"` attribute instead of modifier classes - [ ] **`admin.css`**: Replace `.admin-form-row` with `.admin-body form > div` or `.admin-body form > .row` — form rows are always direct `
    ` children of `
    ` - [ ] **`admin.css`**: Replace `.admin-label` with `.admin-body form label` — every label in admin forms - [ ] **`admin.css`**: Replace `.admin-input` / `.admin-select` / `.admin-textarea` with `.admin-body form input[type="text"]`, `.admin-body form select`, `.admin-body form textarea` — leverage native element selectors diff --git a/public/admin/account.php b/public/admin/account.php index 2ca4af1..1b1905c 100644 --- a/public/admin/account.php +++ b/public/admin/account.php @@ -23,10 +23,10 @@ if (empty($_SESSION['csrf_token'])) {

    Compte administrateur

    -
    +

    -
    +

    diff --git a/public/admin/add.php b/public/admin/add.php index d56fe9a..3bbcf16 100644 --- a/public/admin/add.php +++ b/public/admin/add.php @@ -46,7 +46,7 @@ function wasSelected($key, $value) {

    Ajouter un TFE

    -
    +

    diff --git a/public/admin/edit.php b/public/admin/edit.php index d5b753b..7f5e7c9 100644 --- a/public/admin/edit.php +++ b/public/admin/edit.php @@ -68,10 +68,10 @@ try {

    Modifier un TFE

    -
    +

    -
    +

    diff --git a/public/admin/import.php b/public/admin/import.php index 45e7287..53a2d37 100644 --- a/public/admin/import.php +++ b/public/admin/import.php @@ -324,7 +324,7 @@ if ($_SERVER['REQUEST_METHOD'] === 'POST' && isset($_FILES['csv_file'])) {

    Importer une liste de TFE

    -
    +
    ⚠ Erreurs :
      @@ -335,7 +335,7 @@ if ($_SERVER['REQUEST_METHOD'] === 'POST' && isset($_FILES['csv_file'])) { -
      +

      diff --git a/public/admin/index.php b/public/admin/index.php index 5e267ea..a12523d 100644 --- a/public/admin/index.php +++ b/public/admin/index.php @@ -68,10 +68,10 @@ document.addEventListener('DOMContentLoaded', () => {

      Liste des TFE

      -
      +

      -
      +

      diff --git a/public/admin/login.php b/public/admin/login.php index c058585..776ddbc 100644 --- a/public/admin/login.php +++ b/public/admin/login.php @@ -30,7 +30,7 @@ $pageTitle = 'Connexion';