Remove inline styles from admin templates; extract to admin.css utility classes

- login.php: removed style= on .admin-form-row and .admin-label (already covered
  by .admin-login-box scoped rules); extracted submit-wrap spacing and full-width
  button to .admin-login-box .admin-submit-wrap and .admin-login-box .admin-btn
- account.php: style="margin-top:3rem" on danger-zone heading moved to
  .admin-section-title--danger modifier; <span style="color:..."> replaced with
  <small> element styled via .admin-danger-zone__description small
- add.php / edit.php / pages-edit.php: all style="align-items:start" removed from
  .admin-form-row (redundant — already the CSS default at line 116 of admin.css);
  banner preview inline styles extracted to .admin-banner-preview / .admin-banner-preview img;
  add-jury button margin extracted to .admin-add-jury-btn; cancel links use .admin-cancel-link

Zero inline style= attributes remain in login, account, add, edit, pages-edit.
This commit is contained in:
Pontoporeia
2026-04-01 16:55:29 +02:00
parent 573747303f
commit 77576e966c
7 changed files with 80 additions and 38 deletions

23
TODO.md
View File

@@ -601,8 +601,7 @@ Goal: rename the tables and column to the canonical M2M pattern (`tags`, `thesis
- `tfe.php` lines 148, 170-172, 193: `font-style:italic`, `margin-top:1.5rem`,
`font-size:.88rem;color:#666`, `color:#999;font-style:italic``.tfe-note-value`,
`.tfe-back-link`, `.tfe-restricted` in `tfe.css`
- `admin/edit.php`: multiple `style=` on `.admin-form-row` and banner preview → modifier
classes in `admin.css`
- [x] `admin/edit.php` + `add.php` + `pages-edit.php`: `style="align-items:start;"` on `.admin-form-row` removed (already default in CSS); banner preview → `.admin-banner-preview` + `.admin-banner-preview img`; jury add-button → `.admin-add-jury-btn`; cancel links → `.admin-cancel-link`
- [x] `index.php` line 146: `style="padding:2rem;color:#666;"``.cards-empty` in `main.css`
- [x] **`.site-nav__right` is a duplicate of `.site-nav__link`** - removed `.site-nav__right` block
@@ -960,15 +959,12 @@ Once the above is applied, the following classes become deletable (element name
the badge/code stays as `<dd>` content.
Removes three classes.
- [ ] **`<h2 class="admin-section-title">` is correct** - scoped subsection headings inside
`<main>` at level 2 are right. The `style="margin-top:3rem;"` on the danger zone heading
→ move to CSS (`.admin-section-title + .admin-danger-zone` or a modifier class).
- [x] **`<h2 class="admin-section-title">` is correct** `style="margin-top:3rem;"` on the
danger zone heading moved to `.admin-section-title--danger` modifier rule in `admin.css`.
- [ ] **`<div class="admin-danger-zone">` containing a `<div class="admin-danger-zone__description">`
and a `<form>`** - the description div wrapping a `<strong>` and a `<span>` is over-wrapped.
The `<strong>` and following text are already inline; they don't need a block wrapper.
Replace `<div class="admin-danger-zone__description">` with `<p>` (it is a paragraph of
warning text). Removes one class and one div.
- [x] **Inline muted description text in `.admin-danger-zone__description`**`<span style="color:…">` replaced
with `<small>` element; CSS rule `.admin-danger-zone__description small` provides the muted colour/size.
(Full replacement of wrapper div with `<p>` tracked separately as structural change.)
### XIV - `public/admin/login.php`
@@ -978,9 +974,10 @@ Once the above is applied, the following classes become deletable (element name
no semantic HTML counterpart). Minor improvement: wrap the whole login box in `<main>` so
it is the page's main landmark (currently there is none on the login page).
- [ ] **Inline styles on the login form rows** - `style="grid-template-columns:1fr;border:none;padding:.4rem 0;"`
on `.admin-form-row` and `style="margin-top:1rem;padding-top:.5rem;"` on `.admin-submit-wrap`
→ extract as a `.admin-form-row--compact` modifier and use in `admin.css`.
- [x] **Inline styles on the login form rows** `style="grid-template-columns:1fr;…"` and
`style="font-size:…"` removed (already handled by `.admin-login-box .admin-form-row` /
`.admin-login-box .admin-label` in CSS). Submit-wrap spacing and full-width button extracted
to `.admin-login-box .admin-submit-wrap` and `.admin-login-box .admin-btn` rules in `admin.css`.
### XV - `public/admin/pages-edit.php`