Skip to content

Commit

Permalink
Fix spacing between govspeak headings and attachment
Browse files Browse the repository at this point in the history
- headings don't have margin bottom in govspeak, so rely on elements following them to have top margin for spacing
- when followed by an attachment, this is a problem because an attachment is a gem component and therefore doesn't have top margin
- solution is to add bottom margin to headings that does not exceed the top margin of other elements, so if both are present they will overlap without a visual difference
- but for attachments the space will be provided by this new bottom margin
- only doing this for H2 for now as this is the only example of this problem in the wild and I'm hesitant to make sweeping changes to govspeak
  • Loading branch information
andysellick committed Feb 6, 2025
1 parent 6d638b0 commit 92edc79
Showing 1 changed file with 1 addition and 2 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -31,12 +31,11 @@

h2 {
margin-top: $govuk-gutter;
margin-bottom: 0;
margin-bottom: govuk-spacing(4);
@include govuk-font($size: 27, $weight: bold);

@include govuk-media-query($from: desktop) {
margin-top: $govuk-gutter * 1.5;
margin-bottom: 0;
}
}

Expand Down

0 comments on commit 92edc79

Please sign in to comment.