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

@@ -276,7 +276,8 @@
}
/* ---- Alert Messages ---- */
.admin-alert {
[role="alert"],
[role="status"] {
padding: 0.75rem 1rem;
border-radius: 3px;
font-size: 0.9rem;
@@ -284,13 +285,13 @@
border-left: 3px solid;
}
.admin-alert--error {
[role="alert"][data-type="error"] {
background: rgba(200, 0, 0, 0.1);
border-color: #c00;
color: #ff6b6b;
}
.admin-alert--success {
[role="status"][data-type="success"] {
background: rgba(0, 150, 80, 0.1);
border-color: #0a0;
color: #4caf50;