From 21b82ccf0cfde80817d5aaf6cf637f0bdc2b68b7 Mon Sep 17 00:00:00 2001 From: wxiaoguang Date: Thu, 17 Aug 2023 08:43:22 +0800 Subject: [PATCH 1/2] fix --- web_src/css/admin.css | 2 +- web_src/css/base.css | 9 ++++++--- web_src/css/repo.css | 2 +- 3 files changed, 8 insertions(+), 5 deletions(-) diff --git a/web_src/css/admin.css b/web_src/css/admin.css index 74e6b10a7c71e..fecae5f2bf989 100644 --- a/web_src/css/admin.css +++ b/web_src/css/admin.css @@ -13,7 +13,7 @@ .admin dl.admin-dl-horizontal dt, .admin dl.admin-dl-horizontal dd { - line-height: 1; + line-height: var(--line-height-default); padding: 5px 0; } diff --git a/web_src/css/base.css b/web_src/css/base.css index 0ea0c81864102..0f854ea5b7048 100644 --- a/web_src/css/base.css +++ b/web_src/css/base.css @@ -9,6 +9,8 @@ --font-weight-medium: 500; --font-weight-semibold: 600; --font-weight-bold: 700; + /* line-height: use the default value as "modules/normalize.css" */ + --line-height-default: 1.15; /* backgrounds */ --checkbox-mask-checked: url('data:image/svg+xml;utf8,'); --checkbox-mask-indeterminate: url('data:image/svg+xml;utf8,'); @@ -518,6 +520,7 @@ a.label, .ui.menu .item { color: var(--color-text); user-select: auto; + line-height: var(--line-height-default); /* fomantic uses "1" which causes overflow problems because "1" doesn't consider the descent part */ } .ui.menu .item > .svg { @@ -1476,7 +1479,7 @@ img.ui.avatar, height: 3em; float: none; display: block; - line-height: 1; + line-height: var(--line-height-default); padding: 0; margin: 0 auto 0.5rem; opacity: 1; @@ -2124,7 +2127,7 @@ table th[data-sortt-desc] .svg { .emoji, .reaction { font-size: 1.25em; - line-height: 1; + line-height: var(--line-height-default); font-style: normal !important; font-weight: var(--font-weight-normal) !important; vertical-align: -0.075em; @@ -2247,7 +2250,7 @@ table th[data-sortt-desc] .svg { } .ui.dropdown { - line-height: 1; /* the dropdown doesn't have default line-height, use this to make the dropdown icon align with plain dropdown */ + line-height: var(--line-height-default); /* the dropdown doesn't have default line-height, use this to make the dropdown icon align with plain dropdown */ } /* dropdown has some kinds of icons: diff --git a/web_src/css/repo.css b/web_src/css/repo.css index 34fa2a0052fc7..99a8ec064c859 100644 --- a/web_src/css/repo.css +++ b/web_src/css/repo.css @@ -390,7 +390,7 @@ } .repository.file.list .non-diff-file-content .header .file-actions .btn-octicon { - line-height: 1; + line-height: var(--line-height-default); padding: 10px 8px; vertical-align: middle; color: var(--color-text); From 9ba7096ba456dbf9910ee6477a3ca018308d57a8 Mon Sep 17 00:00:00 2001 From: silverwind Date: Thu, 17 Aug 2023 23:42:24 +0200 Subject: [PATCH 2/2] padding tweaks --- web_src/css/base.css | 4 ++++ web_src/css/repo.css | 2 +- 2 files changed, 5 insertions(+), 1 deletion(-) diff --git a/web_src/css/base.css b/web_src/css/base.css index 0f854ea5b7048..94dd85814ecdb 100644 --- a/web_src/css/base.css +++ b/web_src/css/base.css @@ -521,6 +521,8 @@ a.label, color: var(--color-text); user-select: auto; line-height: var(--line-height-default); /* fomantic uses "1" which causes overflow problems because "1" doesn't consider the descent part */ + padding-top: 11px; /* counteract line-height change */ + padding-bottom: 11px; /* counteract line-height change */ } .ui.menu .item > .svg { @@ -667,6 +669,8 @@ a.label, .ui.secondary.menu .item { margin-left: 0; margin-right: 0; + padding-top: 10px; /* counteract line-height change */ + padding-bottom: 10px; /* counteract line-height change */ } .ui.secondary.menu .dropdown.item:hover, diff --git a/web_src/css/repo.css b/web_src/css/repo.css index 99a8ec064c859..8e8125a5f4a71 100644 --- a/web_src/css/repo.css +++ b/web_src/css/repo.css @@ -391,7 +391,7 @@ .repository.file.list .non-diff-file-content .header .file-actions .btn-octicon { line-height: var(--line-height-default); - padding: 10px 8px; + padding: 8px; vertical-align: middle; color: var(--color-text); }