-
Notifications
You must be signed in to change notification settings - Fork 116
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
fix: Allow Breadcrumb items to wrap #2869
Conversation
🦋 Changeset detectedLatest commit: 4ee72ab The changes in this PR will be included in the next version bump. This PR includes changesets to release 1 package
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 |
@@ -1,7 +1,6 @@ | |||
.breadcrumb-item { | |||
display: inline-block; | |||
margin-left: -0.35em; | |||
white-space: nowrap; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
If I recall correctly, I think this was put in because of the truncation that's sometimes used with the breadcrumbs. Could you write a lookbook preview with the truncate-css
and Truncate
component to see if there's any bad effects there?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Sure! To clarify, are you asking for two stories—one using primer/css’ truncate and one using primer/view_components’ Truncate? Or, does the Truncate component use the truncate CSS under-the-hood, such that only a single story is necessary?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I think you could use the deprecated Primer::Truncate for the CSS one and the Primer::Beta::Truncate for the standard way.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Stories added!
I don’t see any bad effects from removing white-space: nowrap
.
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Awesome thanks!
What are you trying to accomplish?
Breadcrumb item text is currently prevented from wrapping (via
white-space: nowrap
), which means (at certain viewport sizes and zoom levels) text can overflow offscreen and require horizontal scrolling.Relatedly, WCAG SC 1.4.10: Reflow states:
Screenshots
Integration
No changes beyond bumping the version.
List the issues that this change affects.
Part of https://github.com/github/accessibility-audits/issues/7360 (Hubber login required) — This issue can be closed after 1. This PR is merged. 2. A new version of Primer View Components is published. 3. GitHub Classroom’s Primer View Components version is updated.
Risk Assessment
This is a one-line CSS change. It changes the presentation of Breadcrumbs’ text, but it does not change, add, or remove text.
What approach did you choose and why?
I chose to remove the line of CSS that prevented Breadcrumb text from wrapping. The default CSS permits wrapping.
Anything you want to highlight for special attention from reviewers?
Is there any truncation happening in Breadcrumb? If so, how will this change interact?
Accessibility
Merge checklist
Take a look at the What we look for in reviews section of the contributing guidelines for more information on how we review PRs.