Suggestion: Extend heading padding-top adjustment to cover other heading like elements. #5012
Labels
🐛 bug
Something isn't working the way it should (including incorrect wording in documentation)
design
fieldset
label
typography
This bit of the govuk-frontend sass applies extra padding top where a heading follows a paragraph. It's applied to several paragraph classes, but does not apply to labels or legends. These otherwise look identical to headings, and should probably have identical spacing too.
Description of the issue
Legends and labels at a certain size like
l
should look the same as their equivalent heading sizes. Without this adjustment, if a set of radios followed a paragraph (such as on the question page pattern), the radio legend would be too close to the proceeding paragraph - and users would need to use a modifier.Note to achieve this I think we'd want to refactor the css - there's lots of paragraph-like elements to target, and lots of heading-like elements. And then the heading elements may be direct siblings or else direct descendants of a sibling (in the case of legends and labels).
Not something to directly use, but here is a refactor that ChatGPT attempted (using nhsuk styles, but govuk would be very similar):
The text was updated successfully, but these errors were encountered: