codu icon indicating copy to clipboard operation
codu copied to clipboard

Primary Navigation Styling and Semantics

Open garyb1 opened this issue 2 years ago • 6 comments

Context

  1. Provide active styles to the current active link
  2. Markup the current page with aria-current="page". This represents the current page within a set of pages. You can use this attribute as a hook for styling. You can read more about this on Adrian Roselli's Post Using CSS to Enforce Accessibility
  3. Ensure navigation landmarks have a unique accessible name. Differentiate between the primary navigation and the footer navigation by providing an accessible name to the nav elements.

Expected Behavior

Example Markup


<nav aria-label="primary">
  <ul role="list">
     <li><a href="/home" aria-current="page">Home</a></li>
     <li><a href="/articles">Articles</a></li>
  </ul>
</nav>

Current Behavior

No semantics or styling provided

Screenshots

Codu website primary navbar

Steps to reproduce

Inspect primary navigation on all pages

garyb1 avatar Nov 24 '23 16:11 garyb1

Uh oh! @garyb1, the image you shared is missing helpful alt text. Check your issue body.

Alt text is an invisible description that helps screen readers describe images to blind or low-vision users. If you are using markdown to display images, add your alt text inside the brackets of the markdown image.

Learn more about alt text at Basic writing and formatting syntax: images on GitHub Docs.

github-actions[bot] avatar Nov 24 '23 16:11 github-actions[bot]

@NiallJoeMaher see github action above .. even I miss it sometimes!

garyb1 avatar Nov 24 '23 16:11 garyb1

Alt text added 👍

garyb1 avatar Nov 24 '23 16:11 garyb1

That's fantastic! I love our new alt text bot. 🦾

NiallJoeMaher avatar Nov 25 '23 08:11 NiallJoeMaher

I'm going to take this one! Redesigning our nav now.

NiallJoeMaher avatar Dec 17 '23 10:12 NiallJoeMaher

Sure thing @NiallJoeMaher ..got any designs you'd like me to review? 🙂

garyb1 avatar Dec 18 '23 21:12 garyb1