Browse Source

Add header margin change

Andrew Morgan 2 years ago
parent
commit
3360be1829
1 changed files with 14 additions and 1 deletions
  1. 14 1
      docs/website_files/section-headers.css

+ 14 - 1
docs/website_files/section-headers.css

@@ -4,4 +4,17 @@
  */
 .chapter-item {
     margin-left: 1em;
-}
+}
+
+/*
+ * Prevents a large gap between successive section headers.
+ *
+ * mdbook sets 'margin-top: 2.5em' on h2 and h3 headers. This makes sense when separating
+ * a header from the paragraph beforehand, but has the downside of introducing a large
+ * gap between headers that are next to each other with no text in between.
+ *
+ * This rule reduces the margin in this case.
+ */
+ h1 + h2, h2 + h3 {
+    margin-top: 1.0em;
+ }