-
Notifications
You must be signed in to change notification settings - Fork 106
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
Support classes and attributes in header primary links #978
Support classes and attributes in header primary links #978
Conversation
6d609ee
to
08042c7
Compare
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This would be super helpful, using all kinds of hacks at the moment to try and style individual navigation items.
Might also be a good idea to bring in the attributes
macro used by GOV.UK Frontend (and added in #969) via a separate PR so that boolean attributes are supported properly.
@paulrobertlloyd yeah it's part of #969 - though I now think it's probably better to bring it in as a separate pr sooner so that it can apply to other components and not be blocked by task list. |
@edwardhorsford nice - if you can pull that into a separate PR and get that merged, I can use the macro in the one. |
Description
This adds support for adding optional custom CSS classes or other HTML attributes to the list item tags of the primary links within the Header component.
This gives the header navigation a bit more flexibility to be customised by services, who may wish to do things like highlighting the current section, having some items left-aligned and some right aligned, colour-coding the sections, adding data attributes for testing purposes, or other things we’ve not yet thought of.
The options are enabled by supporting
classes
andattributes
as params within theprimaryLinks
objects in the Nunjucks macro, like this:Checklist