Skip to content

Commit

Permalink
💄 override some of the worst non-collapsing margin offenders (#4172)
Browse files Browse the repository at this point in the history
  • Loading branch information
danyx23 authored Nov 19, 2024
2 parents 88e3efb + 736ec6b commit 858faeb
Showing 1 changed file with 21 additions and 0 deletions.
21 changes: 21 additions & 0 deletions site/css/content.scss
Original file line number Diff line number Diff line change
Expand Up @@ -269,3 +269,24 @@ figure[data-explorer-src] {
code {
white-space: pre-wrap; // make sure long code lines do not overflow
}

/*******************************************************************************
* Grid margin collapse quickfixes
* We should probably consider solving this another way but for now we
* fix the most common cases with these quickfixes.
*/

.grid .article-block__text + .h2-bold,
.grid .article-block__list + .h2-bold,
.grid .article-block__text + .h3-bold,
.grid .article-block__list + .h3-bold {
// take the default margin-top of h2/3 and subtract the default margin of the p element above
margin-top: calc(48px - 16px);
}

// Images directly under headings have enough space with just the
// margin-bottom of the heading.
.grid .h2-bold + .article-block__image,
.grid .h3-bold + .article-block__image {
margin-top: 0px;
}

0 comments on commit 858faeb

Please sign in to comment.