HmrcPageHeadingLegend and HmrcPageHeadingLabel both allow a caption to be added into the h1. However, they don't include the govuk-caption-xl class (or -l, -m etc.) that styles the caption. The result is that the caption has the same colour, size and weight as the main part of the h1.
Steps to reproduce the issue
Implement a component, for example some radio buttons with a caption, and observe the rendered HTML. For example:
The legend / label is rendered, with the hmrc-caption correctly applied to the relevant span, but without a class to style the caption. I would expect to be able to supply the size (xl, l etc.) and have the class applied to the relevant span.
From a brief inspection of the code, the HTML appears to be rendered by the pageHeadingCaption method on HmrcPageHeading.
So - it turns out the service I found this issue in was a couple of minor versions behind, and this was already fixed in a later version! Hence I'm closing the issue :)
Library or service name
play-frontend-hmrc
Library version (where applicable)
3.11.0-play-28
Description of the issue
HmrcPageHeadingLegend and HmrcPageHeadingLabel both allow a caption to be added into the h1. However, they don't include the
govuk-caption-xl
class (or-l
,-m
etc.) that styles the caption. The result is that the caption has the same colour, size and weight as the main part of the h1.Steps to reproduce the issue
Implement a component, for example some radio buttons with a caption, and observe the rendered HTML. For example:
Actual vs expected behaviour
The legend / label is rendered, with the
hmrc-caption
correctly applied to the relevant span, but without a class to style the caption. I would expect to be able to supply the size (xl, l etc.) and have the class applied to the relevant span.From a brief inspection of the code, the HTML appears to be rendered by the
pageHeadingCaption
method onHmrcPageHeading
.Environment (where applicable)
N/A