mirror of
https://codeberg.org/PostERG/xamxam.git
synced 2026-06-25 16:19:19 +02:00
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).
147 lines
3.4 KiB
CSS
147 lines
3.4 KiB
CSS
/* ============================================================
|
|
BUTTONS — Shared .btn base class with variant modifiers.
|
|
Targets both <a> and <button>. Always has a background.
|
|
Root class: .btn
|
|
============================================================ */
|
|
|
|
.btn {
|
|
display: inline-flex;
|
|
align-items: center;
|
|
justify-content: center;
|
|
gap: var(--space-3xs);
|
|
padding: var(--space-xs);
|
|
border-radius: var(--radius);
|
|
font-size: var(--step--1);
|
|
font-family: inherit;
|
|
font-weight: 500;
|
|
letter-spacing: 0.04em;
|
|
cursor: pointer;
|
|
text-decoration: none;
|
|
line-height: 1.3;
|
|
border: none;
|
|
transition: background 0.15s, opacity 0.15s, box-shadow 0.15s, filter 0.15s;
|
|
width: fit-content;
|
|
}
|
|
|
|
.btn:hover { filter: brightness(0.92); }
|
|
|
|
/* Primary: accent background, white text */
|
|
.btn--primary {
|
|
background: var(--accent-primary);
|
|
color: var(--accent-foreground);
|
|
border: 1px solid transparent;
|
|
}
|
|
|
|
.btn--primary:hover {
|
|
background: var(--accent-secondary);
|
|
filter: none;
|
|
}
|
|
|
|
/* Secondary: light background with border */
|
|
.btn--secondary {
|
|
background: var(--bg-primary);
|
|
color: var(--text-secondary);
|
|
border: 1px solid var(--border-primary);
|
|
}
|
|
|
|
.btn--secondary:hover {
|
|
border-color: var(--text-secondary);
|
|
color: var(--text-primary);
|
|
filter: none;
|
|
}
|
|
|
|
/* Muted secondary: bg-secondary background */
|
|
.btn--muted {
|
|
background: var(--bg-secondary);
|
|
color: var(--text-secondary);
|
|
border: 1px solid var(--border-primary);
|
|
}
|
|
|
|
.btn--muted:hover {
|
|
background: var(--bg-tertiary);
|
|
color: var(--text-primary);
|
|
filter: none;
|
|
}
|
|
|
|
/* Ghost: transparent bg, border, for links styled as buttons */
|
|
.btn--ghost {
|
|
background: transparent;
|
|
color: var(--text-secondary);
|
|
border: 1px solid var(--border-primary);
|
|
}
|
|
|
|
.btn--ghost:hover {
|
|
border-color: var(--text-secondary);
|
|
color: var(--text-primary);
|
|
filter: none;
|
|
}
|
|
|
|
/* Danger: red background */
|
|
.btn--danger {
|
|
background: var(--accent-red);
|
|
color: var(--accent-foreground);
|
|
}
|
|
|
|
.btn--danger:hover { filter: brightness(0.9); }
|
|
|
|
/* Warning: yellow background */
|
|
.btn--warning {
|
|
background: var(--accent-yellow);
|
|
color: var(--text-primary);
|
|
}
|
|
|
|
.btn--warning:hover { filter: brightness(0.9); }
|
|
|
|
/* Success: green background */
|
|
.btn--success {
|
|
background: var(--accent-green);
|
|
color: var(--accent-foreground);
|
|
}
|
|
|
|
.btn--success:hover { filter: brightness(0.9); }
|
|
|
|
/* Small size modifier */
|
|
.btn--sm {
|
|
padding: var(--space-2xs) var(--space-xs);
|
|
font-size: var(--step--2);
|
|
}
|
|
|
|
/* Large size modifier */
|
|
.btn--lg {
|
|
padding: var(--space-s) var(--space-m);
|
|
font-size: var(--step-0);
|
|
}
|
|
|
|
/* Semantic colour modifiers on muted base (for table/action buttons) */
|
|
.btn--blue {
|
|
background: var(--blue-muted-bg);
|
|
color: var(--accent-blue);
|
|
border: 1px solid var(--blue-muted-border);
|
|
}
|
|
|
|
.btn--blue:hover { background: var(--blue-muted-bg-hover); filter: none; }
|
|
|
|
.btn--yellow {
|
|
background: var(--yellow-muted-bg);
|
|
color: var(--accent-yellow);
|
|
border: 1px solid var(--yellow-muted-border);
|
|
}
|
|
|
|
.btn--yellow:hover { background: var(--yellow-muted-bg-hover); filter: none; }
|
|
|
|
.btn--green {
|
|
background: var(--green-muted-bg);
|
|
color: var(--accent-green);
|
|
border: 1px solid var(--green-muted-border);
|
|
}
|
|
|
|
.btn--green:hover { background: var(--green-muted-bg-hover); filter: none; }
|
|
|
|
.btn--red {
|
|
background: var(--error-muted-bg);
|
|
color: var(--error);
|
|
border: 1px solid var(--danger-border-muted);
|
|
}
|
|
|
|
.btn--red:hover { filter: brightness(0.9); }
|