Closed frankieroberto closed 1 day ago
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