From 5d61094226745ad7e19026799dbd9e854f35c10a Mon Sep 17 00:00:00 2001 From: xRangerDE Date: Mon, 11 May 2026 02:43:23 +0200 Subject: [PATCH] cleanup: extract recurring inline form patterns into utility classes MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Audit turned up two ~6-occurrence inline-style patterns in Settings: - `style="font-size:12px; color:var(--text-secondary);"` on small sub-labels above stacked inputs (autoCleanupDaysLabel, TargetLabel, ActionLabel, autoVodPollMinutesLabel, autoVodMaxAgeHoursLabel, statsLastScannedLabel) - `style="display:flex; flex-direction:column; gap:4px; flex:1; min-width:NNNpx;"` on labels that wrap a sublabel + control as a vertical pair in a flex row (3 of these in the auto-cleanup grid) Both lifted to .form-sublabel and .form-stack utility classes. Plus a .form-note for block-level secondary-coloured text (the cleanupReport "X files would be freed" panel). The min-width values stay inline since they vary per call site (120 / 160 / 200). Zero visual change — the class values match what was inline. Future edits to "what does a small label look like" go through one selector instead of grep + sed across six sites. Co-Authored-By: Claude Opus 4.7 (1M context) --- src/index.html | 20 ++++++++++---------- src/styles.css | 30 ++++++++++++++++++++++++++++++ 2 files changed, 40 insertions(+), 10 deletions(-) diff --git a/src/index.html b/src/index.html index 4f86f2e..771056d 100644 --- a/src/index.html +++ b/src/index.html @@ -422,7 +422,7 @@

Archiv-Statistik

- +
@@ -706,19 +706,19 @@ Auto-Cleanup aktivieren
-
diff --git a/src/styles.css b/src/styles.css index 6ab0621..c30558f 100644 --- a/src/styles.css +++ b/src/styles.css @@ -1900,6 +1900,36 @@ select option { letter-spacing: 0.4px; } +/* ============================================ + FORM UTILITY CLASSES — small recurring patterns + ============================================ + These replace the 6+ inline-style copies of the same visual + pattern that were scattered across Settings cards. */ + +/* Small secondary-coloured label / note text. Used as field-label + above stacked inputs, as inline metadata next to controls, etc. */ +.form-sublabel { + font-size: 12px; + color: var(--text-secondary); +} + +/* Vertical stack: label on top, control below, equal flex share in + a flex-row. Used for the 3-up auto-cleanup row + poll-config rows. */ +.form-stack { + display: flex; + flex-direction: column; + gap: 4px; + flex: 1; +} + +/* Block-level note text — same colour as .form-sublabel but reserved + for full-row paragraphs like the cleanup report area. */ +.form-note { + color: var(--text-secondary); + font-size: 12px; + line-height: 1.45; +} + /* Old generic scrollbar rules were dead — superseded by the purple-themed *::-webkit-scrollbar block further down the file. Removed to avoid confusion when someone greps for scrollbar styles. */