Refactor CSS architecture per css-methodology-spec.md

Split CSS into named layers: reset → colors → typography → base →
components → utilities. Each component has one unique root class in
its own file. No cross-component overrides.

New files:
- reset.css (modern-normalize base — matches project's prior reset)
- colors.css (all colour variables)
- typography.css (font faces, size/space scale, font-family vars)
- base.css (≤ 5 site-wide rules: layout, headings)
- utilities.css (sr-only, skip-link, reduced-motion)
- style.css (root @import file loading all layers)
- components/{links,focus,forms,tables,dialog,details,media,
  buttons,badges,toasts,pagination,header,search}.css

Existing files:
- variables.css → backward-compat wrapper (imports colors + typography)
- common.css → backward-compat wrapper (imports style.css)
- Page files (admin, public, form, tfe, apropos, repertoire, system,
  file-access) → removed redundant @import url(./variables.css)
- head.php → loads style.css instead of modern-normalize + common.css
- partage pages → load style.css

Fixes vs initial refactoring:
- reset.css: use modern-normalize base (not Tailwind Preflight) to
  avoid border/list/heading regressions from aggressive defaults
- components/search.css: restore !important flags on input styles
  (needed to override forms.css base input selectors)
- acces.php: add toast feedback on password copy button

Cleaned up duplicate status-badge/toast definitions from admin.css
(now live in components/badges.css and components/toast.css).
This commit is contained in:
Pontoporeia
2026-05-19 14:55:10 +02:00
parent 7c30d1c55d
commit 7cf020c7bd
36 changed files with 1254 additions and 1052 deletions

View File

@@ -116,7 +116,7 @@
margin-top: var(--space-l);
}
/* ── Admin button aliases — see common.css .btn base class ────────────── */
/* ── Admin button aliases — see components/buttons.css .btn base class ─── */
.admin-btn {
/* deprecated alias for .btn--primary; kept for backward-compat */
@@ -138,67 +138,7 @@
/* deprecated alias for .btn--danger; kept for backward-compat */
}
/* ── Toast messages (bottom-center, CSS-only auto-fade) ─────────────── */
#toast-region {
position: fixed;
bottom: var(--space-l);
left: 50%;
transform: translateX(-50%);
z-index: 10000;
display: flex;
flex-direction: column;
align-items: center;
gap: var(--space-xs);
pointer-events: none;
width: max-content;
max-width: min(560px, calc(100vw - 2 * var(--space-l)));
}
.toast {
padding: var(--space-s) var(--space-m);
border-radius: var(--radius);
font-size: var(--step-0);
border-left: 4px solid;
box-shadow: 0 6px 24px rgba(0, 0, 0, 0.25);
pointer-events: auto;
/* enter then fade out — total visible ~6.35 s */
animation: toast-enter 0.35s ease-out,
toast-exit 0.5s ease-in 6s forwards;
}
.toast--error {
background: var(--bg-secondary);
border-color: var(--error);
color: var(--text-primary);
}
.toast--success {
background: var(--bg-secondary);
border-color: var(--success);
color: var(--text-primary);
}
.toast--warning {
background: var(--bg-secondary);
border-color: var(--warning);
color: var(--text-primary);
animation: toast-enter 0.35s ease-out; /* no fade-out — stays until dismissed */
}
.toast--warning a {
color: inherit;
text-decoration: underline;
}
@keyframes toast-enter {
from { opacity: 0; transform: translateY(12px); }
to { opacity: 1; transform: translateY(0); }
}
@keyframes toast-exit {
from { opacity: 1; }
to { opacity: 0; pointer-events: none; }
}
/* ── Toast messages — styles in components/toast.css ───────────────── */
/* ── Stats cards ────────────────────────────────────────────────────────── */
.admin-stats {
@@ -352,7 +292,7 @@
}
/* ── Table ──────────────────────────────────────────────────────────────── */
/* Base table/th/td styles live in common.css */
/* Base table/th/td styles live in components/tables.css */
.admin-body main > table {
margin-top: var(--space-m);
}
@@ -406,52 +346,10 @@ th.admin-ap-col {
}
/* ── Status badges ──────────────────────────────────────────────────────── */
.status-badge {
display: inline-block;
padding: var(--space-3xs) var(--space-2xs);
border-radius: var(--radius);
font-size: var(--step--2);
font-weight: 500;
letter-spacing: 0.04em;
}
/* ── Status badges — base styles in components/badges.css ─────────── */
.status-published {
background: var(--green-muted-bg);
color: var(--accent-green);
}
.status-pending {
background: var(--warning-muted-bg);
color: var(--warning);
}
.status-access {
display: inline-block;
font-size: var(--step--2);
padding: var(--space-3xs) var(--space-3xs);
border-radius: var(--radius);
background: var(--bg-tertiary);
color: var(--text-secondary);
letter-spacing: 0.03em;
}
.status-access--libre {
background: var(--green-muted-bg);
color: var(--accent-green);
}
.status-access--interne {
background: var(--blue-muted-bg);
color: var(--accent-blue);
}
.status-access--interdit {
background: var(--error-muted-bg);
color: var(--error);
}
/* ── Compact table badges ─────────────────────────────────────────── */
.status-badge {
/* ── Compact table badges (admin-only override) ──────────────────── */
.admin-body .status-badge {
font-size: 0.7rem;
padding: 2px var(--space-3xs);
}
@@ -541,7 +439,7 @@ th.admin-ap-col {
border-color: var(--yellow-muted-border);
}
/* ── Action buttons in table — see common.css .btn base class ──────────── */
/* ── Action buttons in table — see components/buttons.css .btn base class ─ */
.admin-actions {
display: flex;
gap: var(--space-3xs);
@@ -1030,7 +928,7 @@ th.admin-ap-col {
}
/* ── Dialog ───────────────────────────────────────────────────────────── */
/* Base dialog/::backdrop styles live in common.css */
/* Base dialog/::backdrop styles live in components/dialog.css */
.admin-dialog {
max-width: 680px;
width: 100%;