Skip to content

Conversation

@qheaden-stack
Copy link
Collaborator

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

STACKS-755, Partially resolves A11Y-15

@netlify
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

  • Updated Navigation component documentation describing data-text (see button group)
  • Updated visual regression images (I haven't updated the visual regression images since I'm not 100% that the design won't get modified)
  • Guidance from design about width increase due to this change (see #1894 (comment))

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
@changeset-bot
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.

@dancormier dancormier merged commit ed521b9 into develop Jul 23, 2025
11 checks passed
@dancormier dancormier deleted the qheaden/a11y/navigation-component-updates branch July 23, 2025 21:10
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.

5 participants