Skip to content
This repository has been archived by the owner on Jan 20, 2022. It is now read-only.

Button: Add 4 more pixels of padding to the right of icons #257

Merged
merged 1 commit into from
Nov 16, 2020

Conversation

justinanastos
Copy link
Contributor

@justinanastos justinanastos commented Nov 6, 2020

πŸ“¦ Published PR as canary version: 8.2.1-canary.257.6522.0

✨ Test out this PR locally via:

npm install @apollo/space-kit@8.2.1-canary.257.6522.0
# or 
yarn add @apollo/space-kit@8.2.1-canary.257.6522.0

@justinanastos justinanastos added the minor Increment the minor version when merged label Nov 6, 2020
@@ -519,7 +519,7 @@ export const Button = React.forwardRef<HTMLElement, Props>(
{icon && (
<ButtonIcon
iconSize={iconSize}
className={css({ margin: iconOnly ? 0 : "0 4px 0" })}
className={css({ margin: iconOnly ? 0 : "0 8px 0 4px" })}
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

While we are in here, do we need the 4px on the left?

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks for pointing this out, @Jephuff. I just noticed that there is a bit of a discrepancy between the icon spacing in the Space Kit design file:

image

...and in our current implementation in Storybook:

image

What makes this kind of difficult to both notice and address is that in the design file the button uses two words, but in the storybook version it uses just a single short word. So the question is what is the correct spacing?

Visually, I think it looks cleanest to have equal spacing between the icon and the left edge and the icon and the start of the word (or just a hair more between the icon and the button edge, if any).

But I also see that the buttons have a min-width applied to them, which makes this a bit tricker. Is there any reasons we need the min width on these?

Regardless of the answer to that, I'm in favor of @Jephuff's suggestion to drop the 4px on the left. πŸ‘

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

PS - case in point where this came up as awkward was in this thread for updating the new graph button, and the spacing looks weird:

image

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks for this input! I'll axe that 4px and then send another PR testing getting rid of the min-width!

@justinanastos justinanastos merged commit 1002126 into main Nov 16, 2020
@justinanastos justinanastos deleted the justin/button-icon-margin branch November 16, 2020 19:24
@apollo-bot2
Copy link
Collaborator

πŸš€ PR was released in v8.3.0 πŸš€

@apollo-bot2 apollo-bot2 added the released This issue/pull request has been released. label Nov 16, 2020
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
minor Increment the minor version when merged released This issue/pull request has been released.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants