mirror of
https://github.com/go-gitea/gitea.git
synced 2026-11-19 15:14:40 +09:00
fix(ui): center notification badge count and normalize dimensions (#40400)
Fixes #33479 The notification count, stopwatch dot, and navbar admin badge appeared vertically sunken / uncentered on high-DPI displays (such as 1440p) and across varying browser zoom levels. This was caused by: 1. Fractional horizontal padding (3.75px) and odd height (17px with 2px borders = 13px content height), causing subpixel rounding splits during flexbox alignment. 2. A fixed line-height (12px) which offset the baseline of un-descended numerals within the flex container. This change: - Updates height and min-width to 18px (14px inner content box) for clean integer alignment. - Sets line-height to 1 for tight font bounding box centering. - Normalizes horizontal padding to 4px. - Adjusts font-size to 11px to preserve comfortable spacing inside the badge. - Replaces hardcoded border-radius with var(--border-radius-full). Signed-off-by: Francesco Passaquindici <k3n.solver@gmail.com> Signed-off-by: Francesco Passaquindici <k3n.solver@gmail.com>
This commit is contained in:
1 file changed
+6
-6
@@ -86,18 +86,18 @@
|
||||
#navbar .header-stopwatch-dot,
|
||||
#navbar .navbar-admin-badge {
|
||||
color: var(--color-nav-bg);
|
||||
padding: 0 3.75px;
|
||||
font-size: 12px;
|
||||
line-height: 12px;
|
||||
padding: 0 4px;
|
||||
font-size: 11px;
|
||||
line-height: 1;
|
||||
font-weight: var(--font-weight-bold);
|
||||
background: var(--color-primary);
|
||||
border: 2px solid var(--color-nav-bg);
|
||||
position: absolute;
|
||||
left: calc(100% - 9px);
|
||||
bottom: calc(100% - 9px);
|
||||
min-width: 17px;
|
||||
height: 17px;
|
||||
border-radius: 11px; /* (height + 2 * borderThickness) / 2 */
|
||||
min-width: 18px;
|
||||
height: 18px;
|
||||
border-radius: var(--border-radius-full);
|
||||
display: flex;
|
||||
align-items: center;
|
||||
justify-content: center;
|
||||
|
||||
Reference in new issue
Block a user