-
Notifications
You must be signed in to change notification settings - Fork 336
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
Should label in Nunjucks be wrapped in a condition? #714
Comments
Ideally not having a label input would result in a hard failure with a visible error. If anything we could consider doing something like .govuk-label:empty::after {
content: "Warning: No label for input";
color: red;
font-weight: bold;
} |
Isn't it valid to provide a label separately from the input macro? We provide a label macro |
@NickColley label has whitespace so :empty won't work |
One of the best things about out input component is that we make it hard to forget an associated label by default. If we can do this without compromising that 👍 |
It is valid to provide a label separately, so I think it should be possible not have a label in this macro. We could possibly require |
@joelanman Having general errors also sounds useful. @igloosi was this raised based on an issue you noticed? |
User-facing errors worries me a bit - on a dynamic site, a macro could theoretically be called that shows the end user an error that isn't for them - it's confusing and they can do nothing about it. |
Sure, this could be a development only thing. |
The following code
will output
Empty label, that has a 5px bottom margin, which will effect any alignment
In the input component template we currently don't wrap label in a condition, like we do hint and error message.
The text was updated successfully, but these errors were encountered: