From 62e1a3868c21402c5b0a08a6f92aff2944d1bb32 Mon Sep 17 00:00:00 2001 From: wxiaoguang Date: Fri, 18 Aug 2023 05:50:32 +0800 Subject: [PATCH 1/2] fix --- web_src/css/admin.css | 2 +- web_src/css/base.css | 11 ++++++++--- web_src/css/repo.css | 4 ++-- 3 files changed, 11 insertions(+), 6 deletions(-) diff --git a/web_src/css/admin.css b/web_src/css/admin.css index 1423b651dd18f..77dae54974176 100644 --- a/web_src/css/admin.css +++ b/web_src/css/admin.css @@ -45,7 +45,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 556bee0d1ad50..b883bdfb81297 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,'); @@ -509,6 +511,9 @@ 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 */ + padding-top: 11px; /* counteract line-height change */ + padding-bottom: 11px; /* counteract line-height change */ } .ui.menu .item > .svg { @@ -1517,7 +1522,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; @@ -2170,7 +2175,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; @@ -2294,7 +2299,7 @@ table th[data-sortt-desc] .svg { } .ui.dropdown { - line-height: 1em; /* 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 676d748184834..70b4812ba3273 100644 --- a/web_src/css/repo.css +++ b/web_src/css/repo.css @@ -403,8 +403,8 @@ } .repository.file.list .non-diff-file-content .header .file-actions .btn-octicon { - line-height: 1; - padding: 10px 8px; + line-height: var(--line-height-default); + padding: 8px; vertical-align: middle; color: var(--color-text); } From 181a9da8ebe77893308aae5ca83d94b5111accb4 Mon Sep 17 00:00:00 2001 From: wxiaoguang Date: Tue, 22 Aug 2023 18:19:15 +0800 Subject: [PATCH 2/2] fix --- web_src/css/base.css | 4 +--- web_src/css/modules/normalize.css | 2 +- 2 files changed, 2 insertions(+), 4 deletions(-) diff --git a/web_src/css/base.css b/web_src/css/base.css index b883bdfb81297..60803de6d9587 100644 --- a/web_src/css/base.css +++ b/web_src/css/base.css @@ -10,7 +10,7 @@ --font-weight-semibold: 600; --font-weight-bold: 700; /* line-height: use the default value as "modules/normalize.css" */ - --line-height-default: 1.15; + --line-height-default: normal; /* backgrounds */ --checkbox-mask-checked: url('data:image/svg+xml;utf8,'); --checkbox-mask-indeterminate: url('data:image/svg+xml;utf8,'); @@ -512,8 +512,6 @@ 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 { diff --git a/web_src/css/modules/normalize.css b/web_src/css/modules/normalize.css index 406869f7fb4c7..9f9856aa9021f 100644 --- a/web_src/css/modules/normalize.css +++ b/web_src/css/modules/normalize.css @@ -25,7 +25,7 @@ Use a better box model (opinionated). } html { - line-height: 1.15; /* 1. Correct the line height in all browsers. */ + line-height: normal; /* 1. (not following the "modern-normalize") Do not change the browser's default line-height, the default value is font-dependent and roughly 1.2 */ -webkit-text-size-adjust: 100%; /* 2. Prevent adjustments of font size after orientation changes in iOS. */ }