Skip to content

Commit

Permalink
Switch to using has-icon
Browse files Browse the repository at this point in the history
  • Loading branch information
richtabor committed Aug 15, 2023
1 parent 716380a commit ad3fca9
Show file tree
Hide file tree
Showing 2 changed files with 9 additions and 5 deletions.
4 changes: 2 additions & 2 deletions packages/commands/src/components/command-menu.js
Original file line number Diff line number Diff line change
Expand Up @@ -57,7 +57,7 @@ function CommandMenuLoader( { name, search, hook, setLoader, close } ) {
className={ classnames(
'commands-command-menu__item',
{
'with-no-icon': ! command.icon,
'has-icon': command.icon,
}
) }
>
Expand Down Expand Up @@ -130,7 +130,7 @@ export function CommandMenuGroup( { isContextual, search, setLoader, close } ) {
<HStack
alignment="left"
className={ classnames( 'commands-command-menu__item', {
'with-no-icon': ! command.icon,
'has-icon': command.icon,
} ) }
>
{ command.icon && <Icon icon={ command.icon } /> }
Expand Down
10 changes: 7 additions & 3 deletions packages/commands/src/components/style.scss
Original file line number Diff line number Diff line change
Expand Up @@ -66,7 +66,6 @@
cursor: pointer;
display: flex;
align-items: center;
padding: $grid-unit;
color: $gray-900;
font-size: $default-font-size;
min-height: $button-size-next-default-40px;
Expand All @@ -90,8 +89,13 @@
fill: $gray-900;
}

> .with-no-icon {
padding-left: $grid-unit-40; // Align text, even without icons.
> div {
padding: $grid-unit;
padding-left: $grid-unit-50; // Account for commands without icons.
}

> .has-icon {
padding-left: $grid-unit;
}
}

Expand Down

0 comments on commit ad3fca9

Please sign in to comment.