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

@@ -0,0 +1,112 @@
/* ============================================================
FORMS — Base input, select, textarea, fieldset, legend
styling shared across admin + public pages.
Root: element selectors (universal form styling)
============================================================ */
/* ── Labels ─────────────────────────────────────────────────────────── */
label {
display: block;
margin-bottom: var(--space-3xs);
}
/* ── Text inputs, selects, textareas ────────────────────────────────── */
input:not([type="checkbox"]):not([type="radio"]):not([type="file"]):not([type="hidden"]):not([type="submit"]):not([type="button"]):not([type="reset"]):not([type="color"]),
textarea {
font-family: inherit;
font-size: var(--step--1);
padding: var(--space-2xs) var(--space-xs);
border: 1px solid var(--border-primary);
border-radius: var(--radius);
background: transparent;
color: var(--text-primary);
transition: border-color 0.15s;
}
input:not([type="checkbox"]):not([type="radio"]):not([type="file"]):not([type="hidden"]):not([type="submit"]):not([type="button"]):not([type="reset"]):not([type="color"]):focus,
textarea:focus {
outline: none;
border: 2px solid var(--accent-primary);
}
input::placeholder,
textarea::placeholder {
color: var(--text-tertiary);
font-size: var(--step--1);
}
textarea {
resize: vertical;
min-height: 80px;
line-height: 1.5;
}
/* ── Select ─────────────────────────────────────────────────────────── */
select {
font-family: inherit;
font-size: var(--step--1);
padding: var(--space-2xs) var(--space-xs);
padding-right: 1.75rem;
border: 1px solid var(--border-primary);
border-radius: var(--radius);
background: transparent;
color: var(--text-primary);
cursor: pointer;
background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='8' viewBox='0 0 12 8'%3E%3Cpath d='M1 1l5 5 5-5' stroke='%23999' stroke-width='1.5' fill='none' stroke-linecap='round'/%3E%3C/svg%3E");
background-repeat: no-repeat;
background-position: right 0.55rem center;
-webkit-appearance: none;
appearance: none;
transition: border-color 0.15s;
}
select:focus {
outline: none;
border: 2px solid var(--accent-primary);
}
/* ── Checkboxes & radios ────────────────────────────────────────────── */
input[type="checkbox"],
input[type="radio"] {
accent-color: var(--accent-primary);
width: 16px;
height: 16px;
cursor: pointer;
flex-shrink: 0;
margin: 0;
}
input[type="radio"] { border-radius: 50%; }
/* ── Fieldsets & legends ──────────────────────────────────────────────── */
fieldset {
border: 1px solid var(--border-primary);
border-radius: var(--radius);
padding: 0 var(--space-m) var(--space-m) var(--space-m);
margin: 0;
}
fieldset > *:not(:last-child) { margin-bottom: var(--space-xs); }
legend {
font-size: var(--step--1);
font-weight: 600;
letter-spacing: 0.04em;
text-transform: uppercase;
color: var(--text-secondary);
padding: 0 var(--space-2xs);
}
/* ── Small / help text ──────────────────────────────────────────────────── */
small {
font-size: var(--step--2);
color: var(--text-secondary);
display: block;
margin-top: var(--space-3xs);
}