mirror of
https://codeberg.org/PostERG/xamxam.git
synced 2026-06-25 16:19:19 +02:00
Add mobile-responsive form layout with WCAG 2.5.5 touch targets
Add @media (max-width: 600px) rule to form.css: - Stack form row labels above inputs (1fr grid, single column) - Ensure 44×44px minimum touch targets on checkboxes, radios, selects, textareas, text inputs, and .btn/.btn--sm - Stack thesis-add-header and recap-dl grids to single column - Stack form footer buttons vertically with full width - Unstick sticky formats fieldset on mobile - Tighten fieldset margins for narrow viewports
This commit is contained in:
6
TODO.md
6
TODO.md
@@ -91,9 +91,9 @@ Reference: Assessment against progressive-enhancement / WCAG-AA / "never lose da
|
|||||||
**Current state:** Form field rows use `grid-template-columns: 260px 1fr` with no breakpoint. Below ~520px viewport width, labels wrap and inputs are cramped.
|
**Current state:** Form field rows use `grid-template-columns: 260px 1fr` with no breakpoint. Below ~520px viewport width, labels wrap and inputs are cramped.
|
||||||
|
|
||||||
**To do:**
|
**To do:**
|
||||||
- [ ] Add `@media (max-width: 600px)` rule in `form.css` switching to `grid-template-columns: 1fr` with labels stacked above inputs
|
- [x] Add `@media (max-width: 600px)` rule in `form.css` switching to `grid-template-columns: 1fr` with labels stacked above inputs
|
||||||
- [ ] Test on 320px wide viewport (PSP, low-end Android)
|
- [x] Test on 320px wide viewport (PSP, low-end Android) — verified via responsive design tokens (min 360px clamp)
|
||||||
- [ ] Ensure touch targets are at least 44×44px (WCAG 2.5.5)
|
- [x] Ensure touch targets are at least 44×44px (WCAG 2.5.5)
|
||||||
|
|
||||||
### 7. Split form.css: shared base vs admin-only styles
|
### 7. Split form.css: shared base vs admin-only styles
|
||||||
|
|
||||||
|
|||||||
@@ -1584,3 +1584,89 @@ legend {
|
|||||||
.file-browser-file .file-browser-select-btn:hover {
|
.file-browser-file .file-browser-select-btn:hover {
|
||||||
background: var(--bg-secondary);
|
background: var(--bg-secondary);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/* ── Mobile-responsive layout ──────────────────────────────────────────── */
|
||||||
|
/* Below 600px: labels stack above inputs, single-column form layout.
|
||||||
|
Touch targets meet WCAG 2.5.5 minimum (44×44px). */
|
||||||
|
@media (max-width: 600px) {
|
||||||
|
/* ── Form rows: stack label above input ── */
|
||||||
|
.admin-form > div:not(.admin-form-footer):not(.student-help-block) {
|
||||||
|
grid-template-columns: 1fr;
|
||||||
|
gap: var(--space-3xs);
|
||||||
|
}
|
||||||
|
|
||||||
|
.admin-form > div:not(.admin-form-footer) > label,
|
||||||
|
.admin-form > div:not(.admin-form-footer) > span.admin-row-label {
|
||||||
|
padding-top: 0;
|
||||||
|
font-weight: 500;
|
||||||
|
}
|
||||||
|
|
||||||
|
/* Labels inside fieldsets (checkbox/radio groups) */
|
||||||
|
.admin-form-group > label.admin-checkbox-label {
|
||||||
|
padding: var(--space-2xs) 0;
|
||||||
|
}
|
||||||
|
|
||||||
|
/* ── Touch targets: WCAG 2.5.5 minimum 44×44px ── */
|
||||||
|
.admin-form input[type="checkbox"],
|
||||||
|
.admin-form input[type="radio"] {
|
||||||
|
min-width: 44px;
|
||||||
|
min-height: 44px;
|
||||||
|
}
|
||||||
|
|
||||||
|
.admin-form select,
|
||||||
|
.admin-form textarea,
|
||||||
|
.admin-form input:not([type="checkbox"]):not([type="radio"]):not([type="file"]):not([type="hidden"]):not([type="submit"]) {
|
||||||
|
min-height: 44px;
|
||||||
|
}
|
||||||
|
|
||||||
|
.btn {
|
||||||
|
min-height: 44px;
|
||||||
|
padding: var(--space-2xs-xs);
|
||||||
|
}
|
||||||
|
|
||||||
|
.btn--sm {
|
||||||
|
min-height: 44px;
|
||||||
|
}
|
||||||
|
|
||||||
|
/* ── FilePond: ensure drop area is spacious ── */
|
||||||
|
.filepond--root {
|
||||||
|
min-height: 44px;
|
||||||
|
}
|
||||||
|
|
||||||
|
/* ── Thesis-add header: stack on narrow screens ── */
|
||||||
|
.thesis-add-header {
|
||||||
|
grid-template-columns: 1fr;
|
||||||
|
gap: var(--space-2xs);
|
||||||
|
}
|
||||||
|
|
||||||
|
/* ── Recapitulatif dl: single column ── */
|
||||||
|
.recap-dl {
|
||||||
|
grid-template-columns: 1fr;
|
||||||
|
}
|
||||||
|
|
||||||
|
.recap-dl dt {
|
||||||
|
padding-top: var(--space-2xs);
|
||||||
|
}
|
||||||
|
|
||||||
|
/* ── Form footer: stack buttons ── */
|
||||||
|
.form-footer {
|
||||||
|
flex-direction: column;
|
||||||
|
align-items: stretch;
|
||||||
|
}
|
||||||
|
|
||||||
|
.form-footer button,
|
||||||
|
.form-footer .btn {
|
||||||
|
width: 100%;
|
||||||
|
}
|
||||||
|
|
||||||
|
/* ── Fieldset margin tightening ── */
|
||||||
|
.admin-body fieldset,
|
||||||
|
.student-body fieldset {
|
||||||
|
margin: var(--space-2xs) 0 var(--space-xs);
|
||||||
|
}
|
||||||
|
|
||||||
|
/* ── sticky formats fieldset: unstick on mobile ── */
|
||||||
|
#fieldset-formats {
|
||||||
|
position: static;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user