Skip to content

Commit 2b554d6

Browse files
committed
Fix heading line-height causing overlapping text (#573)
Currently, headings use the same absolute line height as regular text. Due to their larger font size this can cause headings to overlap when wrapped due to small screen width (e.g. on mobile). This change makes line-height relative to the current font size instead of the font size for regular text. Margins were adjusted to keep distance to previous and following text sections approximately the same as before. ### Before ![image](https://user-images.githubusercontent.com/11900073/222900606-22aedece-923f-4ea2-a9d7-6c31c60f70f6.png) ### After ![image](https://user-images.githubusercontent.com/11900073/222900613-8a5143f7-56dd-4c22-829f-2a67fddb8099.png)
1 parent 9558a49 commit 2b554d6

File tree

2 files changed

+4
-3
lines changed

2 files changed

+4
-3
lines changed

sass/pages/_content.scss

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -3,14 +3,15 @@ $content-font-size: 1.22rem;
33
width: 100%;
44
font-size: $content-font-size;
55
font-weight: 400;
6-
line-height: $content-font-size * 1.43;
6+
line-height: 1.43;
77
color: #d2d2d2;
88
font-style: normal;
99
text-decoration: none;
1010
word-break: break-word;
1111

1212
h2 {
13-
margin-top: 3.0rem;
13+
margin-top: 2.2rem;
14+
margin-bottom: 0.5rem;
1415
font-size: 2.2rem;
1516

1617
code {

sass/pages/_news.scss

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -40,7 +40,7 @@
4040
}
4141

4242
.release-feature-authors {
43-
margin-top: -1.0rem !important;
43+
margin-top: -0.5rem !important;
4444
font-style: italic;
4545
color: $subtitle-color;
4646
}

0 commit comments

Comments
 (0)