Skip to content

Commit

Permalink
Added a spacer between icon and badge (#684)
Browse files Browse the repository at this point in the history
  • Loading branch information
rasmuswoelk authored Oct 31, 2018
1 parent c3e50a3 commit a0e44a9
Show file tree
Hide file tree
Showing 3 changed files with 18 additions and 7 deletions.
21 changes: 16 additions & 5 deletions lib/IconButton/IconButton.css
Original file line number Diff line number Diff line change
Expand Up @@ -16,11 +16,6 @@
background: none;
color: var(--color-icon);

/* Let the button expand in width if we have a badge */
&.hasBadge {
width: auto;
}

& + .iconButton {
margin-left: 0.25em;
}
Expand Down Expand Up @@ -50,3 +45,19 @@
}
}
}

/**
* With badge
*/

/* Let the button expand in width if we have a badge */
.iconButton.hasBadge {
width: auto;
}

/* Add spacing between icon and badge */
.hasBadge .icon::after {
content: '';
width: 0.3em;
display: inline-block;
}
2 changes: 1 addition & 1 deletion lib/IconButton/IconButton.js
Original file line number Diff line number Diff line change
Expand Up @@ -68,7 +68,7 @@ const IconButton = React.forwardRef(({
return (
<Element {...buttonProps}>
<span className={classNames(css.iconButtonInner, css[`${size}Offset`])} {...rest}>
<Icon icon={icon} size={iconSize} iconClassName={iconClassName} />
<Icon icon={icon} size={iconSize} iconRootClass={css.icon} iconClassName={iconClassName} />
{ badgeCount !== undefined && <Badge size="medium" color={badgeColor}>{badgeCount}</Badge> }
</span>
</Element>
Expand Down
2 changes: 1 addition & 1 deletion lib/Selection/Selection.css
Original file line number Diff line number Diff line change
Expand Up @@ -38,7 +38,7 @@

&.marginBottom0 {
/* stylelint-disable-next-line length-zero-no-unit */
margin-bottom: 0px;
margin-bottom: 0;
}
}

Expand Down

0 comments on commit a0e44a9

Please sign in to comment.