Skip to content

Commit 4697c77

Browse files
committed
Fix styling issues with button
1 parent ca57590 commit 4697c77

File tree

2 files changed

+27
-20
lines changed

2 files changed

+27
-20
lines changed

packages/react/src/Breadcrumbs/Breadcrumbs.module.css

Lines changed: 14 additions & 20 deletions
Original file line numberDiff line numberDiff line change
@@ -17,37 +17,23 @@
1717
flex-direction: row;
1818
}
1919

20-
[data-overflow='menu'] .BreadcrumbsItem {
20+
.BreadcrumbsItem {
2121
display: inline-grid;
2222
grid-auto-flow: column;
2323
align-items: center;
24-
}
25-
26-
.BreadcrumbsItem {
27-
display: inline-block;
24+
flex: 0 99999 auto;
25+
min-width: auto;
2826
font-size: var(--text-body-size-medium);
2927
white-space: nowrap;
3028
list-style: none;
3129

32-
&::after {
33-
display: inline-block;
34-
height: 0.8em;
35-
/* stylelint-disable-next-line primer/spacing */
36-
margin: 0.25em 0.5em 0 0.5em;
37-
font-size: var(--text-body-size-medium);
38-
content: '';
39-
/* stylelint-disable-next-line primer/borders, primer/colors */
40-
border-right: 0.1em solid var(--fgColor-muted);
41-
transform: rotate(15deg) translateY(0.0625em);
42-
}
43-
4430
&:first-child {
4531
margin-left: 0;
4632
}
4733

4834
&:last-child {
49-
&::after {
50-
content: none;
35+
.ItemSeparator {
36+
display: none;
5137
}
5238
}
5339
}
@@ -75,5 +61,13 @@
7561

7662
.MenuButton {
7763
color: var(--fgColor-link);
78-
padding-top: 4px;
64+
}
65+
66+
.ItemSeparator {
67+
color: var(--fgColor-muted);
68+
display: flex;
69+
align-self: center;
70+
justify-content: center;
71+
white-space: nowrap;
72+
user-select: none;
7973
}

packages/react/src/Breadcrumbs/Breadcrumbs.tsx

Lines changed: 13 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -240,18 +240,21 @@ function Breadcrumbs({className, children, sx: sxProp, overflow = 'wrap', hideRo
240240
items={effectiveMenuItems}
241241
aria-label={`${effectiveMenuItems.length} more breadcrumb items`}
242242
/>
243+
<ItemSeparator />
243244
</li>
244245
)
245246

246247
const visibleElements = visibleItems.map((child, index) => (
247248
<li className={classes.BreadcrumbsItem} key={`visible + ${index}`}>
248249
{child}
250+
<ItemSeparator />
249251
</li>
250252
))
251253

252254
const rootElement = (
253255
<li className={classes.BreadcrumbsItem} key={`rootElement`}>
254256
{rootItem}
257+
<ItemSeparator />
255258
</li>
256259
)
257260

@@ -279,6 +282,16 @@ function Breadcrumbs({className, children, sx: sxProp, overflow = 'wrap', hideRo
279282
)
280283
}
281284

285+
const ItemSeparator = () => {
286+
return (
287+
<span className={classes.ItemSeparator}>
288+
<svg width="16" height="16" viewBox="0 0 16 16" xmlns="http://www.w3.org/2000/svg" aria-hidden="true">
289+
<path d="M10.956 1.27994L6.06418 14.7201L5 14.7201L9.89181 1.27994L10.956 1.27994Z" fill="currentcolor" />
290+
</svg>
291+
</span>
292+
)
293+
}
294+
282295
type StyledBreadcrumbsItemProps = {
283296
to?: To
284297
selected?: boolean

0 commit comments

Comments
 (0)