nhsuk / nhsuk-service-manual

Design and build digital services for the NHS. Use the service manual to build consistent, usable services that put people first.​ Learn from the research and experience of other NHS teams.
https://service-manual.nhs.uk
MIT License
64 stars 25 forks source link

Draft guidance on support classes and attributes in header primary links #1994

Closed sarawilcox closed 1 month ago

sarawilcox commented 1 month ago

We will need some guidance on the design system header component if we support classes and attributes in header primary links in the frontend. See Support classes and attributes in header primary links #978(.

For example, noting that highlighting current section can help users identify where they are on the site or in transactional journey. We might mention that it may not work on very big websites, like the NHS website, where people have long and complex journeys across sections - and into areas of the site not covered in the top nav links.

@frankieroberto, if you have any suggestions for guidance, would you mind noting it here, please? Also @anandamaryon1?

frankieroberto commented 1 month ago

@sarawilcox I was imagining that the only documentation for classes and attributes on primaryLinks would be adding those to the Nunjucks macro, which I’ve drafted here: https://github.com/nhsuk/nhsuk-service-manual/issues/1994 – I don’t think those options are mentioned in the guidance for any other components, although I could be wrong?

We could mention some of the possible use cases, such as highlighting the current section, but that might be quite tricky as none of those styles would be included, and so users would also have to add some custom CSS.

I was planning a follow-up proposal to add support for 'current section' as more of a first-class feature, which would probably use another param like "current": true, and then wouldn’t need any use of custom attributes or classes or css. That would definitely need some good documentation though!

anandamaryon1 commented 1 month ago

Update release, Nunjucks macro options added but no further guidance added.