Skip to content

Commit 9eafca1

Browse files
Merge pull request #1729 from NYPL/DSD-1924/heading-line-height
DSD-1924: Heading component mobile line height
2 parents b80eca2 + 1b8fb55 commit 9eafca1

File tree

4 files changed

+21
-13
lines changed

4 files changed

+21
-13
lines changed

CHANGELOG.md

+1
Original file line numberDiff line numberDiff line change
@@ -11,6 +11,7 @@ Currently, this repo is in Prerelease. When it is released, this project will ad
1111
### Updates
1212

1313
- Updates the `Pagination` component to handle 4 digit page counts.
14+
- Updates the `Heading` component to add `line-height` styles for mobile.
1415

1516
## 3.5.2 (January 16, 2025)
1617

src/components/Heading/Heading.mdx

+4-4
Original file line numberDiff line numberDiff line change
@@ -9,10 +9,10 @@ import { changelogData } from "./headingChangelogData";
99

1010
# Heading
1111

12-
| Component Version | DS Version |
13-
| ----------------- | ---------- |
14-
| Added | `0.0.4` |
15-
| Latest | `3.4.2` |
12+
| Component Version | DS Version |
13+
| ----------------- | ------------ |
14+
| Added | `0.0.4` |
15+
| Latest | `Prerelease` |
1616

1717
## Table of Contents
1818

src/components/Heading/headingChangelogData.ts

+7
Original file line numberDiff line numberDiff line change
@@ -9,6 +9,13 @@
99
import { ChangelogData } from "../../utils/ComponentChangelogTable";
1010

1111
export const changelogData: ChangelogData[] = [
12+
{
13+
date: "Prerelease",
14+
version: "Prerelease",
15+
type: "Update",
16+
affects: ["Styles"],
17+
notes: ["Adds `line-height` styles for mobile."],
18+
},
1219
{
1320
date: "2024-11-07",
1421
version: "3.4.2",

src/theme/components/heading.ts

+9-9
Original file line numberDiff line numberDiff line change
@@ -71,7 +71,7 @@ export const headings = {
7171
},
7272
fontWeight: "heading.display1",
7373
letterSpacing: "0.0625rem",
74-
lineHeight: "1.10",
74+
lineHeight: { base: "1.15", md: "1.10" },
7575
width: "auto",
7676
a: { textUnderlineOffset: "7px" },
7777
},
@@ -84,7 +84,7 @@ export const headings = {
8484
},
8585
fontWeight: "heading.heading1",
8686
letterSpacing: "0.0625rem",
87-
lineHeight: "1.15",
87+
lineHeight: { base: "1.20", md: "1.15" },
8888
width: "auto",
8989
a: { textUnderlineOffset: "6px" },
9090
},
@@ -97,7 +97,7 @@ export const headings = {
9797
},
9898
fontWeight: "heading.heading2",
9999
letterSpacing: "0.0625rem",
100-
lineHeight: "1.20",
100+
lineHeight: { base: "1.25", md: "1.20" },
101101
width: "auto",
102102
a: { textUnderlineOffset: "5px" },
103103
},
@@ -110,7 +110,7 @@ export const headings = {
110110
},
111111
fontWeight: "heading.heading3",
112112
letterSpacing: "0",
113-
lineHeight: "1.25",
113+
lineHeight: { base: "1.30", md: "1.25" },
114114
width: "auto",
115115
a: { textUnderlineOffset: "4px" },
116116
},
@@ -123,7 +123,7 @@ export const headings = {
123123
},
124124
fontWeight: "heading.heading4",
125125
letterSpacing: "0",
126-
lineHeight: "1.30",
126+
lineHeight: { base: "1.35", md: "1.30" },
127127
width: "auto",
128128
a: { textUnderlineOffset: "3px" },
129129
},
@@ -136,7 +136,7 @@ export const headings = {
136136
},
137137
fontWeight: "heading.heading5",
138138
letterSpacing: "0",
139-
lineHeight: "1.35",
139+
lineHeight: { base: "1.40", md: "1.35" },
140140
width: "auto",
141141
},
142142
}),
@@ -148,7 +148,7 @@ export const headings = {
148148
},
149149
fontWeight: "heading.heading6",
150150
letterSpacing: "0",
151-
lineHeight: "1.40",
151+
lineHeight: { base: "1.45", md: "1.40" },
152152
width: "auto",
153153
},
154154
}),
@@ -160,7 +160,7 @@ export const headings = {
160160
},
161161
fontWeight: "heading.heading7",
162162
letterSpacing: "0",
163-
lineHeight: "1.45",
163+
lineHeight: { base: "1.50", md: "1.45" },
164164
width: "auto",
165165
},
166166
}),
@@ -172,7 +172,7 @@ export const headings = {
172172
},
173173
fontWeight: "heading.heading8",
174174
letterSpacing: "0",
175-
lineHeight: "1.50",
175+
lineHeight: "1.50", // The lineHeight value is the same for mobile and desktop because the fontSize value is the same for mobile and desktop.
176176
width: "auto",
177177
},
178178
}),

0 commit comments

Comments
 (0)