Skip to content
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

Check what the states of a navigation item look like currently #3955

Closed
2 tasks done
Tracked by #3888 ...
CharlotteDowns opened this issue Jul 26, 2024 · 3 comments
Closed
2 tasks done
Tracked by #3888 ...

Check what the states of a navigation item look like currently #3955

CharlotteDowns opened this issue Jul 26, 2024 · 3 comments

Comments

@CharlotteDowns
Copy link
Contributor

CharlotteDowns commented Jul 26, 2024

What

Check what the active state of a navigation item looks like currently.

Identify what the navigation item looks like if there:

  • is no href (link)
  • is a active: true state
  • is a current: true state

Why

In order to determine when to suggest applying different visual styles to the navigation item.

Done when

  • all states have been recognised
  • design suggestions made
@CharlotteDowns CharlotteDowns self-assigned this Jul 26, 2024
@CharlotteDowns CharlotteDowns changed the title Check what the active state of a navigation item looks like currently Check what the states of a navigation item look like currently Jul 26, 2024
@CharlotteDowns
Copy link
Contributor Author

CharlotteDowns commented Jul 26, 2024

In the Nunjucks of the navigation we can set different aria-current values.

Current

current: true sets aria-current="page" and indicates that the user is on that specific page.

How this affects the styling of the navigation item

A blue border bottom is added to the navigation item which has the state applied.
Navigation item for 'People' with a current state and a href, the text is blue and focusable, the bottom border is blue
Navigation item for 'People' with a current state and no href, the text is black, the bottom border is blue

Active

active: true sets aria-current="true" and indicates that the user is on a child page of that section.

How this affects the styling of the navigation item

A blue border bottom is added to the navigation item which has the state applied.
Navigation item for 'People' with a active state and a href, the text is blue and focusable, the bottom border is blue
Navigation item for 'People' with a active state and no href, the text is black, the bottom border is blue

In the Nunjucks we can also remove the href: 'link to thing'

No href

In some cases Design System users may wish to remove the ability for a navigation link to be selected when it is active or current

How this affects the styling of the navigation item

Removing the href no longer makes the text a link and therefore the text returns to standard body styling, font-weight 400 and color: #0b0c0c.
Navigation item for 'People/ with no active states and no href, the text is black and there is no border bottom

@CharlotteDowns
Copy link
Contributor Author

Design Suggestion for an unlinked active state

I'm wondering if we can add a conditional style for .govuk-service-header__navigation-item--active when there is no hrefto change the border bottom to a border-color of #0b0c0c.

A service name and navigation bar with an active item with no href which has a black border bottom

cc: @querkmachine

@CharlotteDowns
Copy link
Contributor Author

We also have an explanation of the matrix of all the different paramaters in Add conditional styles for different active states of the navigation items which builds on top of the findings in this issue.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
Status: Done 🏁
Development

No branches or pull requests

1 participant