-
Notifications
You must be signed in to change notification settings - Fork 325
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
Make it easier to add a hint or an error message to a fieldset #1281
Conversation
a9367dc
to
839189a
Compare
This change moves:
Into a macro:
So will need documenting here (to be created): |
839189a
to
371a7d1
Compare
Hey Colin, We are currently prioritising work to make GOV.UK Frontend pass WCAG 2.1 requirements and we have an external audit soon. This work looks really well done, we want to discuss it as a team and make sure it's the right approach, and then give some proper feedback. We're not going to be able to follow up on this until we've done the audit so thanks a lot for your patience. :) Nick |
0632f0f
to
11bd792
Compare
Moved the |
db3c4a7
to
5746c6b
Compare
5746c6b
to
ee1cacd
Compare
Provides the following: 1. govukLabel() 2. govukHint() 3. govukErrorMessage() With optional nested govukFieldset() via params.fieldset
ee1cacd
to
37c139a
Compare
Hey @colinrotherham, Thanks again for your work on this. This change makes a lot of sense, but because of the limitations of Nunjucks it ends up breaking a lot of the conventions we’ve built for how components should work. For that reason, we're going to close it. We have got an epic next quarter to look at improving the way the macros work, and we’ll definitely be looking to do something similar if we can work out how to make it fit (for example, by finding a way to do merge objects) Thanks for your patience - we’ve been somewhat preoccupied with the work on 3.0, but we need to work out how to better handle contributions like this so we don’t leave people hanging. Ollie |
This feature adds a new macro
govukFormGroup()
to resolve #1166.Because
govukFieldset()
is a wrapper only, it's up to services to manage the hint and error message markup themselves when making more complex multi-field pages.Duplicated inside almost all form control macros is Nunjucks code to generate a
govukLabel()
label, agovukHint()
hint an agovukErrorMessage()
error message:It's used by textarea, select, radios, checkboxes, text input, file upload and date input.
This allows us to port existing services with more complex multi-field pages (often with some fields nested inside other fieldsets) like this:
With little markup like:
This merge request demonstrates how we might remove the management of hints and error messages making new Nunjucks macros and form layouts a little easier to write in future.