Skip to content

Commit

Permalink
fixup(DeparturesAndMap): allow text wrapping
Browse files Browse the repository at this point in the history
Adjust the "Back to all routes" control so that it can wrap long test.
While we're here, also change this element to a button. This enables keyboard navigability and is more accessible.
  • Loading branch information
thecristen committed Aug 2, 2023
1 parent 50fc27d commit bca51f8
Show file tree
Hide file tree
Showing 2 changed files with 19 additions and 21 deletions.
28 changes: 13 additions & 15 deletions apps/site/assets/css/_stop-card.scss
Original file line number Diff line number Diff line change
Expand Up @@ -303,24 +303,22 @@ $radius: 4px;
}

.back-to-routes {
align-items: center;
background-color: $gray-bordered-background;
border: .25px solid $gray-lighter;
color: $brand-primary;
display: flex;
font-size: 1rem;
height: 2.5rem;
padding-left: .625rem;
text-decoration: underline;
text-underline-offset: .2rem;
:first-child {
cursor: pointer;
display: inline-block;
font-weight: 400;
:first-child {
font-weight: 900;
padding-right: .5rem;
}

.btn {
align-items: baseline;
display: flex;
gap: .5em;
padding: $base-spacing-sm;
white-space: unset;
}

span {
text-align: left;
text-decoration: underline;
text-underline-offset: .2rem;
}
}

Expand Down
12 changes: 6 additions & 6 deletions apps/site/assets/ts/stop/components/DeparturesAndMap.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -154,15 +154,15 @@ const DeparturesAndMap = ({

const BackToRoutes = (
<div className="back-to-routes">
<div
<button
className="btn"
onClick={unsetDepartureInfo}
onKeyDown={unsetDepartureInfo}
aria-label={`Back to all ${stop.name} routes`}
role="presentation"
type="button"
>
{renderFa("", "fa-angle-left")}
{`Back to all ${stop.name} routes`}
</div>
{renderFa("", "fa-fw fa-angle-left")}
<span className="btn-link">{`Back to all ${stop.name} routes`}</span>
</button>
</div>
);

Expand Down

0 comments on commit bca51f8

Please sign in to comment.