loading up the forgejo repo on tangled to test page performance
0
fork

Configure Feed

Select the types of activity you want to include in your feed.

Use flex for switch items (#6544)

[skip ci] no related tests (covered by visual testing only)

Followup to https://codeberg.org/forgejo/forgejo/pulls/6459.

More specifically, to https://codeberg.org/forgejo/forgejo/pulls/6459#issuecomment-2562521. Thanks, @viceice!

I found a good reason to use `display: flex;` for the switch items: it prevents whitespaces between HTML tags from showing up between the icon and the text.

I was wondering why the new switch is wider, now I noticed why while playing with it. Lack of this additional whitespace looks better and is consistent with most of the UI.

## Preview

|Description|Image|
|-|-|
|The margin that's supposed to be (no whitespace)|![](https://codeberg.org/attachments/c0377eaa-7dec-4ef1-a4d6-70ad67608a8c)|
|Redesigned switch before|![](https://codeberg.org/attachments/d05bb17a-7e5f-4356-9840-2682f5b31f8a)|
|After|![](https://codeberg.org/attachments/b62c9373-395c-47a3-a8aa-b6905a22b11a)|

Reviewed-on: https://codeberg.org/forgejo/forgejo/pulls/6544
Reviewed-by: Michael Kriese <michael.kriese@gmx.de>
Reviewed-by: Otto <otto@codeberg.org>
Co-authored-by: 0ko <0ko@noreply.codeberg.org>
Co-committed-by: 0ko <0ko@noreply.codeberg.org>

authored by

0ko
0ko
and committed by
Otto
03fe21d0 9a608a03

+3 -5
+3 -5
web_src/css/modules/switch.css
··· 10 10 } 11 11 12 12 .switch .item { 13 - color: var(--color-text); 13 + display: flex; 14 + align-items: center; 14 15 padding: .5em 1.125em; 16 + color: var(--color-text); 15 17 border-radius: var(--border-radius); 16 18 text-wrap: nowrap; 17 19 } ··· 20 22 background: var(--color-active); 21 23 outline: 1px solid var(--color-input-border); 22 24 } 23 - 24 - .switch .item svg { 25 - vertical-align: sub; 26 - }