Skip to content

Commit 2854259

Browse files
committed
Some css improvements
1 parent 92b813e commit 2854259

File tree

2 files changed

+20
-23
lines changed

2 files changed

+20
-23
lines changed

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

Lines changed: 16 additions & 20 deletions
Original file line numberDiff line numberDiff line change
@@ -42,57 +42,54 @@
4242
[data-overflow='menu-with-root'] .Item {
4343
display: inline-block;
4444
font-size: var(--text-body-size-medium);
45-
color: var(--fgColor-link);
45+
color: var(--fgColor-default);
4646
text-decoration: none;
4747
padding-inline: var(--base-size-6);
4848
padding-block: var(--base-size-4);
4949
border-radius: var(--borderRadius-medium);
5050

5151
&:hover {
5252
background: var(--control-transparent-bgColor-hover);
53+
text-decoration: none;
5354
}
5455

5556
&:focus {
56-
box-shadow: none;
57-
outline: 2px solid var(--focus-outlineColor, var(--color-accent-fg));
58-
outline-offset: -2px;
57+
@mixin focusOutline;
5958
}
6059
}
6160

62-
.MenuSummary {
63-
list-style: none;
64-
display: inline-block;
65-
outline: none;
66-
height: 0.5rem;
67-
}
68-
69-
.MenuSummary::-webkit-details-marker {
70-
display: none;
71-
}
72-
7361
.MenuDetails {
7462
position: relative;
7563
display: inline-block;
7664
}
7765

78-
.MenuDetails summary {
66+
summary {
7967
list-style: none;
8068
cursor: pointer;
8169
outline: none;
8270
}
8371

84-
.MenuDetails summary::-webkit-details-marker {
72+
summary::-webkit-details-marker {
8573
display: none;
8674
}
8775

8876
.MenuOverlay {
8977
position: absolute;
9078
z-index: 1;
91-
box-shadow: var(--shadow-resting-medium);
79+
box-shadow: var(--shadow-resting-small);
9280
border-radius: var(--borderRadius-large);
9381
background-color: var(--overlay-bgColor);
9482
list-style: none;
95-
width: max-content;
83+
min-width: var(--overlay-width-xsmall);
84+
max-height: 100vh;
85+
max-width: var(--overlay-width-small);
86+
overflow: hidden;
87+
}
88+
89+
@media (prefers-reduced-motion: no-preference) {
90+
.MenuOverlay {
91+
animation: overlay-appear 200ms cubic-bezier(0.33, 1, 0.68, 1);
92+
}
9693
}
9794

9895
.ItemSeparator {
@@ -107,7 +104,6 @@
107104
.ItemWrapper {
108105
display: inline-block;
109106
font-size: var(--text-body-size-medium);
110-
white-space: nowrap;
111107
list-style: none;
112108

113109
&::after {

packages/react/src/Breadcrumbs/Breadcrumbs.tsx

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -9,6 +9,7 @@ import {BoxWithFallback} from '../internal/components/BoxWithFallback'
99
import Details from '../Details'
1010
import {ActionList} from '../ActionList'
1111
import {IconButton} from '../Button/IconButton'
12+
import {Tooltip} from '../TooltipV2'
1213
import {KebabHorizontalIcon} from '@primer/octicons-react'
1314
import {useResizeObserver} from '../hooks/useResizeObserver'
1415
import type {ResizeObserverEntry} from '../hooks/useResizeObserver'
@@ -94,19 +95,19 @@ const BreadcrumbsMenuItem = React.forwardRef<HTMLDetailsElement, BreadcrumbsMenu
9495

9596
return (
9697
<Details ref={detailsRefCallback} className={classes.MenuDetails}>
97-
<Details.Summary className={classes.MenuSummary} tabIndex={-1}>
98+
<Tooltip text={ariaLabel || `${items.length} more breadcrumb items`} direction={'e'}>
9899
<IconButton
100+
as="summary"
99101
ref={iconButtonRef}
100102
aria-label={ariaLabel || `${items.length} more breadcrumb items`}
101103
aria-expanded={isOpen ? 'true' : 'false'}
102-
tooltipDirection="w"
103104
onClick={handleSummaryClick}
104105
variant="invisible"
105106
size="small"
106107
icon={KebabHorizontalIcon}
107108
{...rest}
108109
/>
109-
</Details.Summary>
110+
</Tooltip>
110111
<div ref={menuContainerRef} className={classes.MenuOverlay}>
111112
<ActionList>
112113
{items.map((item, index) => {

0 commit comments

Comments
 (0)