Replace .admin-alert BEM classes with semantic role/data-type attributes

- 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: <div class="admin-alert admin-alert--{type}">
  becomes <p role="alert|status" data-type="error|success"> (or <div> for the
  import.php multi-item list that contains a <ul>)
- 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
This commit is contained in:
Pontoporeia
2026-04-02 12:35:23 +02:00
parent 10b07393fe
commit e9e012376d
12 changed files with 21 additions and 20 deletions

View File

@@ -46,7 +46,7 @@ function wasSelected($key, $value) {
<h1>Ajouter un TFE</h1>
<?php if ($error): ?>
<div class="admin-alert admin-alert--error">⚠ <?= htmlspecialchars($error) ?></div>
<p role="alert" data-type="error">⚠ <?= htmlspecialchars($error) ?></p>
<?php endif; ?>
<form action="actions/formulaire.php" method="post" enctype="multipart/form-data" class="admin-form">