-
Notifications
You must be signed in to change notification settings - Fork 934
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
USWDS - Breadcrumb: Allow text to wrap on wrap variants #5497
Conversation
| @@ -87,7 +87,6 @@ $breadcrumb-back-icon-aspect: ( | |||
| .usa-breadcrumb__list-item { | |||
| @include sr-only; | |||
| @include u-display("inline"); | |||
| @include u-white-space("no-wrap"); | |||
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.
This appears to be unnecessary for the standard variant because no-wrap is already declared on the .usa-breadcrumb__list element in line 71. The line 71 rule is applied only to :not(.usa-breadcrumb--wrap), so no override is necessary.
| @@ -16,7 +16,7 @@ | |||
| </a> | |||
| </li> | |||
| <li class="usa-breadcrumb__list-item usa-current" aria-current="page"> | |||
| <span>Women-owned small business federal contracting program</span> | |||
| <span>Economically disadvantaged women-owned small business federal contracting program</span> | |||
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.
Made the text longer to better demonstrate the text wrap
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.
Looks good. Tested both variants in:
- Safari 16.6
- Firefox 118
- Chromium 116
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.
LGTM!
- Wrap variant properly wraps across different browsers
- No visual regression on standard variant across browsers
Chrome visual quirk
On chrome, I noticed a visual quirk in the standard variant where the ellipses overlaps the breadcrumb chevron. The same behavior exists on develop so I don't think it should be a blocker for this PR. I was unable to reproduce on Firefox or Safari.
Let me know if you'd like me to create a new issue to track this!

Summary
Fixed a bug that prevented text from wrapping to a new line in the
.usa-breadcrumb--wrapvariant.Breaking change
This is not a breaking change.
Related issue
Closes #5257
Related pull requests
Changelog PR
Preview link
Problem statement
In the breadcrumb component, all list items (regardless of variant) receive a
white-space: nowraprule. This enables the expected behavior in the standard variant, but prevents text from wrapping In the.usa-breadcrumb--wrapvariant.Solution
By removing the blanket
white-space: nowraprule from list items and instead relying only on the "no-wrap" rule applied to.usa-breadcrumb__listin the standard variant, we can re-enable text wrapping in the.usa-breadcrumb--wrapvariant.Testing and review
In a variety of browsers: