Skip to content

Commit 508c624

Browse files
authored
Backport line height fix (#26708)
Backport the `line-height: normal`, because #26520 was backported
1 parent ecfed9e commit 508c624

File tree

4 files changed

+10
-7
lines changed

4 files changed

+10
-7
lines changed

web_src/css/admin.css

+1-1
Original file line numberDiff line numberDiff line change
@@ -45,7 +45,7 @@
4545

4646
.admin dl.admin-dl-horizontal dt,
4747
.admin dl.admin-dl-horizontal dd {
48-
line-height: 1;
48+
line-height: var(--line-height-default);
4949
padding: 5px 0;
5050
}
5151

web_src/css/base.css

+6-3
Original file line numberDiff line numberDiff line change
@@ -9,6 +9,8 @@
99
--font-weight-medium: 500;
1010
--font-weight-semibold: 600;
1111
--font-weight-bold: 700;
12+
/* line-height: use the default value as "modules/normalize.css" */
13+
--line-height-default: normal;
1214
/* backgrounds */
1315
--checkbox-mask-checked: url('data:image/svg+xml;utf8,<svg xmlns="http://www.w3.org/2000/svg" viewBox="-1 -1 18 18" width="16" height="16"><path fill-rule="evenodd" d="M13.78 4.22a.75.75 0 010 1.06l-7.25 7.25a.75.75 0 01-1.06 0L2.22 9.28a.75.75 0 011.06-1.06L6 10.94l6.72-6.72a.75.75 0 011.06 0z"></path></svg>');
1416
--checkbox-mask-indeterminate: url('data:image/svg+xml;utf8,<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 16 16" width="16" height="16"><path fill-rule="evenodd" d="M2 7.75A.75.75 0 012.75 7h10a.75.75 0 010 1.5h-10A.75.75 0 012 7.75z"></path></svg>');
@@ -509,6 +511,7 @@ a.label,
509511
.ui.menu .item {
510512
color: var(--color-text);
511513
user-select: auto;
514+
line-height: var(--line-height-default); /* fomantic uses "1" which causes overflow problems because "1" doesn't consider the descent part */
512515
}
513516

514517
.ui.menu .item > .svg {
@@ -1517,7 +1520,7 @@ img.ui.avatar,
15171520
height: 3em;
15181521
float: none;
15191522
display: block;
1520-
line-height: 1;
1523+
line-height: var(--line-height-default);
15211524
padding: 0;
15221525
margin: 0 auto 0.5rem;
15231526
opacity: 1;
@@ -2170,7 +2173,7 @@ table th[data-sortt-desc] .svg {
21702173
.emoji,
21712174
.reaction {
21722175
font-size: 1.25em;
2173-
line-height: 1;
2176+
line-height: var(--line-height-default);
21742177
font-style: normal !important;
21752178
font-weight: var(--font-weight-normal) !important;
21762179
vertical-align: -0.075em;
@@ -2294,7 +2297,7 @@ table th[data-sortt-desc] .svg {
22942297
}
22952298

22962299
.ui.dropdown {
2297-
line-height: 1em; /* the dropdown doesn't have default line-height, use this to make the dropdown icon align with plain dropdown */
2300+
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 */
22982301
}
22992302

23002303
/* dropdown has some kinds of icons:

web_src/css/modules/normalize.css

+1-1
Original file line numberDiff line numberDiff line change
@@ -25,7 +25,7 @@ Use a better box model (opinionated).
2525
}
2626

2727
html {
28-
line-height: 1.15; /* 1. Correct the line height in all browsers. */
28+
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 */
2929
-webkit-text-size-adjust: 100%; /* 2. Prevent adjustments of font size after orientation changes in iOS. */
3030
}
3131

web_src/css/repo.css

+2-2
Original file line numberDiff line numberDiff line change
@@ -403,8 +403,8 @@
403403
}
404404

405405
.repository.file.list .non-diff-file-content .header .file-actions .btn-octicon {
406-
line-height: 1;
407-
padding: 10px 8px;
406+
line-height: var(--line-height-default);
407+
padding: 8px;
408408
vertical-align: middle;
409409
color: var(--color-text);
410410
}

0 commit comments

Comments
 (0)