Skip to content

Commit 81273df

Browse files
zecakehrichvdh
andauthored
Adjust margins in rendered endpoints (#2081)
* Use consistent spacing between tables and code blocks Tables used `4 rem` which is more than the margin above a h2 title, which seems excessive. We change it to `2 rem` which matches the margin of code blocks and info boxes. We also remove the margin on the last item of a `.rendered-data` block because this is just wasted space. Signed-off-by: Kévin Commaille <[email protected]> * Adjust spacing around h2 and h3 titles in `.rendered-data` Given that h2 titles are always preceded by an horizontal rule, we don't need a lot of space to separate them from the previous section. We also reduce the spacing when a h2 title is followed directly by a h3 title. Finally, we add a little spacing below both so that tables are less close to the title. Signed-off-by: Kévin Commaille <[email protected]> * Add changelog Signed-off-by: Kévin Commaille <[email protected]> --------- Signed-off-by: Kévin Commaille <[email protected]> Co-authored-by: Richard van der Hoff <[email protected]>
1 parent 65b1db7 commit 81273df

File tree

2 files changed

+20
-7
lines changed

2 files changed

+20
-7
lines changed

assets/scss/_styles_project.scss

Lines changed: 19 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -316,13 +316,19 @@ Custom SCSS for the Matrix spec
316316
h2 {
317317
font-weight: $font-weight-bold;
318318
font-size: 1.3rem;
319-
margin: 3rem 0 .5rem 0;
319+
margin: 1.5rem 0 1rem 0;
320320
}
321321

322322
h3 {
323323
font-weight: $font-weight-bold;
324324
font-size: 1.1rem;
325-
margin: 1.5rem 0 .75rem 0;
325+
margin: 1.5rem 0 1rem 0;
326+
327+
}
328+
329+
/* Reduce top margin of h3 if previous sibling is a h2 */
330+
h2 + h3 {
331+
margin-top: 1rem;
326332
}
327333

328334
hr {
@@ -367,11 +373,6 @@ Custom SCSS for the Matrix spec
367373
}
368374
}
369375

370-
// add some space between two tables when they are right next to each other
371-
& + table {
372-
margin-top: 4rem;
373-
}
374-
375376
caption {
376377
caption-side: top;
377378
color: $dark;
@@ -443,6 +444,17 @@ Custom SCSS for the Matrix spec
443444
}
444445
}
445446

447+
/* Have consistent spacing around tables and examples */
448+
table, .highlight {
449+
margin-top: 0;
450+
margin-bottom: 2rem;
451+
452+
/* We don't need the margin on the last child of the .rendered-data block */
453+
&:last-child {
454+
margin-bottom: 0;
455+
}
456+
}
457+
446458
pre {
447459
border: 0;
448460
border-left: solid 5px $secondary;
Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
Adjust margins in rendered endpoints.

0 commit comments

Comments
 (0)