Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Allow legend size to be nil #511

Merged
merged 1 commit into from
Jul 17, 2024
Merged

Conversation

thomasleese
Copy link
Contributor

This updates the legend element to allow the size attribute to be nil, and when nil a size class won't be specified for the element. This is required to support the case where a field has a legend element but shouldn't have a size class.

There's an example of this kind of component in the GOV.UK Design System:

https://design-system.service.gov.uk/components/date-input/#if-youre-asking-more-than-one-question-on-the-page

It's currently not possible to re-create this example using purely the form builder classes as the size is enforced as one of s, m, l or xl.

Copy link

netlify bot commented Jul 17, 2024

👷 Deploy request for govuk-form-builder pending review.

Visit the deploys page to approve it

Name Link
🔨 Latest commit 6d4f042

This updates the legend element to allow the size attribute to be `nil`,
and when `nil` a size class won't be specified for the element. This is
required to support the case where a field has a legend element but
shouldn't have a size class.

There's an example of this kind of component in the GOV.UK Design
System:

https://design-system.service.gov.uk/components/date-input/#if-youre-asking-more-than-one-question-on-the-page

It's currently not possible to re-create this example using purely the
form builder classes as the size is enforced as one of `s`, `m`, `l` or
`xl`.
@peteryates peteryates merged commit 0dbc552 into x-govuk:main Jul 17, 2024
12 of 13 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants