Skip to content

fix(a11y): Add bold font to selected nav items #1894

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

Open
wants to merge 9 commits into
base: develop
Choose a base branch
from

Conversation

qheaden-stack
Copy link
Collaborator

@qheaden-stack qheaden-stack commented Apr 4, 2025

STACKS-755, Partially resolves A11Y-15

Copy link

netlify bot commented Apr 4, 2025

Deploy Preview for stacks ready!

Name Link
🔨 Latest commit d0fc433
🔍 Latest deploy log https://app.netlify.com/projects/stacks/deploys/682757e01a35a60007160649
😎 Deploy Preview https://deploy-preview-1894--stacks.netlify.app
📱 Preview on mobile
Toggle QR Code...

QR Code

Use your smartphone camera to open QR code link.

To edit notification comments on pull requests, go to your Netlify project configuration.

Copy link
Contributor

@dancormier dancormier left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@qheaden-stack thank you for taking this on! I neglected to mention that the data-text approach requires the addition of a child element to contain the text and the :before pseudo-element (I actually totally forgot this) like in the button group buttons.

In any case, I've added a commit* that adds this element (.s-navigation--item-text) and shuffles around the Less as needed to support it. I'm happy to go over these changes with you if you'd like more detail. Feel free to change anything you see fit. Once this is ready for review, I'm happy to do so but I'd also include Giamir since I made a bunch of changes.

What's needed before merging

Sidenote: I just want to say thanks for picking up these a11y issues. You've been one of the few I've seen picking up issues (I know not everyone has enthusiasm and/or bandwidth for improving accessibility) and I'm glad you make the time and effort to improve our accessibility ❤️


*you can safe ignore my first two commits in this PR. I missed that all my changes included a change to line endings that created changes on every line. The last commit I made includes my changes without this line changes

@dancormier
Copy link
Contributor

@CGuindon I wanted to raise a design concern with you and see how/if we want to address it.

With the addition of the hidden bold text to maintain a consistent size for navigation items between selected states, the items are now all a bit wider:

Before (361px wide)

image

image

After (378px wide)

image

image

This has two potential issues:

  1. This is not the intended design
  2. This could possibly cause layout shifts from what we currently have (this could make the update in Core kinda a pain if we need to mitigate any new undesirable overflow/wrapping)

This issue could potentially be partially mitigated by reducing the gap between navigation items:

With gap reduced from 4px to 1px (366px wide)

image

image

The compromise is that hover state reveals that the navigation items are closer together. I'm happy to brainstorm other ideas or just leave it as-is if that seems right.

@CGuindon
Copy link
Collaborator

CGuindon commented Apr 7, 2025

@dancormier I don't think we can reduce the spacing to 1px — I believe this might cause issues with the focus state (the blue ring adds 1-2 px on the outside sometimes?). I'm honestly not too worried about the navigation get a tiny bit wider. Navigations are already wrapping for responsive screen sizes — I'd be curious to first see if there are any pages where the nav perfectly fits right now and it becomes a big issue for a regular desktop size.

@qheaden-stack qheaden-stack force-pushed the qheaden/a11y/navigation-component-updates branch from 56a606c to f89a02e Compare April 25, 2025 12:55
Copy link

changeset-bot bot commented Apr 25, 2025

🦋 Changeset detected

Latest commit: d0fc433

The changes in this PR will be included in the next version bump.

This PR includes changesets to release 1 package
Name Type
@stackoverflow/stacks Patch

Not sure what this means? Click here to learn what changesets are.

Click here if you're a maintainer who wants to add another changeset to this PR

@qheaden-stack qheaden-stack changed the title WIP - Add bold font to selected nav items fix(a11y): Add bold font to selected nav items Apr 25, 2025
@qheaden-stack qheaden-stack requested a review from giamir April 30, 2025 15:46
@giamir giamir marked this pull request as ready for review May 8, 2025 11:26
Copy link
Contributor

@giamir giamir left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The changes made sense to me. Thanks for picking this up.
Before merging we need to add a changeset.
Also it would be nice to know ahead of time if there is something special we need to watch out for when performing the upgrade in Core. If no side effects are expected we can also cut a release straight away.

@dancormier
Copy link
Contributor

Note: This change is ready but we're delaying merging until prep work has been completed in Core.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants