Skip to content
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(menu): update styles #15236

Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion packages/react/src/components/ComboButton/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@ import { useId } from '../../internal/useId';
import { useMergedRefs } from '../../internal/useMergedRefs';
import { usePrefix } from '../../internal/usePrefix';

const spacing = 4; // top and bottom spacing between the button and the menu. in px
const spacing = 0; // top and bottom spacing between the button and the menu. in px
const defaultTranslations = {
'carbon.combo-button.additional-actions': 'Additional actions',
};
Expand Down
2 changes: 1 addition & 1 deletion packages/react/src/components/Menu/MenuItem.js
Original file line number Diff line number Diff line change
Expand Up @@ -175,7 +175,7 @@ const MenuItem = React.forwardRef(function MenuItem(
<div className={`${prefix}--menu-item__icon`}>
{iconsAllowed && IconElement && <IconElement />}
</div>
<Text as="div" className={`${prefix}--menu-item__label`}>
<Text as="div" className={`${prefix}--menu-item__label`} title={label}>
{label}
</Text>
{shortcut && !hasChildren && (
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -32,7 +32,7 @@ export default {
export const Default = () => (
<MenuButton label="Actions">
<MenuItem label="First action" />
<MenuItem label="Second action" />
<MenuItem label="Second action that is a longer item to test overflow and title." />
<MenuItem label="Third action" disabled />
</MenuButton>
);
Expand Down
2 changes: 1 addition & 1 deletion packages/react/src/components/MenuButton/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@ import { useId } from '../../internal/useId';
import { useMergedRefs } from '../../internal/useMergedRefs';
import { usePrefix } from '../../internal/usePrefix';

const spacing = 4; // top and bottom spacing between the button and the menu. in px
const spacing = 0; // top and bottom spacing between the button and the menu. in px
const validButtonKinds = ['primary', 'tertiary', 'ghost'];
const defaultButtonKind = 'primary';

Expand Down
12 changes: 11 additions & 1 deletion packages/styles/scss/components/menu/_menu.scss
Original file line number Diff line number Diff line change
Expand Up @@ -35,6 +35,7 @@
max-inline-size: 18rem;
min-inline-size: 10rem;
opacity: 0;
overflow-y: auto;
visibility: hidden;
}

Expand Down Expand Up @@ -66,7 +67,7 @@
display: grid;
align-items: center;
block-size: 2rem;
color: $text-primary;
color: $text-secondary;
column-gap: $spacing-03;
cursor: pointer;
grid-template-columns: 1fr max-content;
Expand All @@ -76,10 +77,19 @@
&:focus {
@include focus-outline('outline');
}

svg {
color: $icon-secondary;
}
}

.#{$prefix}--menu-item:hover {
background-color: $layer-hover;
color: $text-primary;

svg {
color: $icon-primary;
}
}

$supported-sizes: (
Expand Down