Skip to content

Commit 5a14726

Browse files
committed
allow y overflow in h1, h2 headings
* change h2 margin calculation to use lh and em units to allow heading-line-height var to be any valid value (no unit requirement)
1 parent a66ab1d commit 5a14726

File tree

2 files changed

+8
-5
lines changed

2 files changed

+8
-5
lines changed

src/themes/shared/_markdown.css

Lines changed: 7 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -252,14 +252,15 @@
252252
/* Prevent long titles from causing horizontal scrolling */
253253
&[id] a {
254254
display: block;
255-
overflow: hidden;
255+
overflow-x: clip;
256+
overflow-y: visible;
256257
text-overflow: ellipsis;
257258
}
258259
}
259260

260261
h1,
261262
h2 {
262-
margin-top: calc(2.5rem - (1lh - 1.275em));
263+
margin-top: 2.5rem;
263264
}
264265

265266
:is(h1, h2, h3, h4, h5, h6) + * {
@@ -275,8 +276,10 @@
275276
}
276277

277278
h2 {
278-
margin-bottom: 0.65em;
279-
padding-bottom: calc(0.5em - (1lh - 1.275em));
279+
--_spacing: 0.5em;
280+
281+
margin-bottom: calc(var(--_spacing) + (1lh - 1em));
282+
padding-bottom: var(--_spacing);
280283
border-bottom: 1px solid var(--border-color);
281284
font-size: var(--font-size-xxl);
282285
}

src/themes/shared/_vars.css

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -115,7 +115,7 @@
115115
--form-element-color : ;
116116
--heading-color : var(--strong-color);
117117
--heading-font-weight : 600;
118-
--heading-line-height : normal;
118+
--heading-line-height : calc(2ex + 5px);
119119
--kbd-bg : var(--color-mono-1);
120120
--kbd-border : 1px solid var(--color-mono-3);
121121
--kbd-border-radius : 4px;

0 commit comments

Comments
 (0)