From 0858a879e57ef01d1070152c84bed9961fe2444d Mon Sep 17 00:00:00 2001 From: 0ko <0ko@noreply.codeberg.org> Date: Mon, 13 Jan 2025 08:28:30 +0000 Subject: [PATCH] Prevent vertical stretching of the switch (#6543) Followup to https://codeberg.org/forgejo/forgejo/pulls/6459 and https://codeberg.org/forgejo/forgejo/pulls/6542. There are some edge cases where the UI would try to stretch the switch. Such inputs aren't really supposed to be dynamically stretched like this because it never looks good. So, I added a few rules to prevent this. ## Preview This is the edge case with an artificially narrow screen. |Before|After| |-|-| |![](/attachments/343d395c-54dd-4d86-a402-0c6b6a06237a)|![](/attachments/26b072a3-4056-4b1a-a08f-e903160609d9)| No visual changes are expected outside of such edge case. Reviewed-on: https://codeberg.org/forgejo/forgejo/pulls/6543 Reviewed-by: Otto Co-authored-by: 0ko <0ko@noreply.codeberg.org> Co-committed-by: 0ko <0ko@noreply.codeberg.org> --- web_src/css/modules/switch.css | 2 ++ 1 file changed, 2 insertions(+) diff --git a/web_src/css/modules/switch.css b/web_src/css/modules/switch.css index 7afb275065..510b6a4bac 100644 --- a/web_src/css/modules/switch.css +++ b/web_src/css/modules/switch.css @@ -1,7 +1,9 @@ .switch { display: grid; grid-auto-flow: column; + height: fit-content; align-items: center; + align-self: center; background: var(--color-menu); border: 1px solid var(--color-input-border); border-radius: var(--border-radius);