@@ -255,8 +255,8 @@ main > ul {
255
255
margin-bottom : 0 ;
256
256
}
257
257
258
- /* Values for h2/h3/h4 margin-top and blockquote margin are taken from mdbook's general.css,
259
- values for h2/h3/h4 margin-bottom are taken from <https://www.w3schools.com/cssref/css_default_values.php> */
258
+ /* Values for header margin-top and blockquote margin are taken from mdbook's general.css,
259
+ values for header margin-bottom are taken from <https://www.w3schools.com/cssref/css_default_values.php> */
260
260
main > h2 {
261
261
margin-top : calc (2.5em - 16px );
262
262
margin-bottom : calc (0.83em - 16px );
@@ -269,6 +269,14 @@ main > h4 {
269
269
margin-top : calc (2em - 16px );
270
270
margin-bottom : calc (1.33em - 16px );
271
271
}
272
+ main > h5 {
273
+ margin-top : calc (2em - 16px );
274
+ margin-bottom : calc (1.67em - 16px );
275
+ }
276
+ main > h6 {
277
+ margin-top : calc (2em - 16px );
278
+ margin-bottom : calc (2.33em - 16px );
279
+ }
272
280
main > blockquote {
273
281
margin-top : calc (20px - 16px );
274
282
margin-bottom : calc (20px - 16px );
@@ -308,7 +316,9 @@ main > .rule {
308
316
.rule : has (+ h1 : target ),
309
317
.rule : has (+ h2 : target ),
310
318
.rule : has (+ h3 : target ),
311
- .rule : has (+ h4 : target ) {
319
+ .rule : has (+ h4 : target ),
320
+ .rule : has (+ h5 : target ),
321
+ .rule : has (+ h6 : target ) {
312
322
padding-right : 24px ;
313
323
}
314
324
@@ -379,6 +389,36 @@ main > .rule {
379
389
)
380
390
}
381
391
392
+ .rule : has (+ h5 ) {
393
+ /* multiplying by this turns h5's em into .rule's em*/
394
+ --h5-em-mult : calc (
395
+ (1 / var (--font-size-mult )) /* to main font size */
396
+ * 0.83 /* to h5 font size */
397
+ );
398
+
399
+ margin-top : calc (
400
+ /* h5 margin top */
401
+ 2em * var (--h5-em-mult ) - 16px
402
+ /* half of the font size difference */
403
+ + (1em * var (--h5-em-mult ) - 1em ) / 2
404
+ )
405
+ }
406
+
407
+ .rule : has (+ h6 ) {
408
+ /* multiplying by this turns h6's em into .rule's em*/
409
+ --h6-em-mult : calc (
410
+ (1 / var (--font-size-mult )) /* to main font size */
411
+ * 0.67 /* to h6 font size */
412
+ );
413
+
414
+ margin-top : calc (
415
+ /* h6 margin top */
416
+ 2em * var (--h6-em-mult ) - 16px
417
+ /* half of the font size difference */
418
+ + (1em * var (--h6-em-mult ) - 1em ) / 2
419
+ )
420
+ }
421
+
382
422
/* Sets the color for [!HISTORY] blockquote admonitions. */
383
423
.history > blockquote {
384
424
background : # f7c0eb ;
0 commit comments