Skip to content

Commit 428fee2

Browse files
committed
Pad internal button elements to correctly space out icons, etc.
1 parent e134051 commit 428fee2

File tree

2 files changed

+16
-1
lines changed

2 files changed

+16
-1
lines changed

Diff for: client/common/Button.jsx

+6-1
Original file line numberDiff line numberDiff line change
@@ -35,6 +35,10 @@ const StyledButton = styled.button`
3535
background-color: ${prop('buttonDisabledColorBackground')};
3636
cursor: not-allowed;
3737
}
38+
39+
> *:not(:last-child) {
40+
margin-right: ${remSize(8)};
41+
}
3842
}
3943
`;
4044

@@ -58,6 +62,7 @@ const Button = ({
5862
Button.defaultProps = {
5963
disabled: false,
6064
href: null,
65+
label: null,
6166
to: null,
6267
type: 'button',
6368
};
@@ -79,7 +84,7 @@ Button.propTypes = {
7984
/*
8085
* An ARIA Label used for accessibility
8186
*/
82-
label: PropTypes.string.isRequired,
87+
label: PropTypes.string,
8388
/**
8489
* Specifying a to URL will use a react-router Link
8590
*/

Diff for: client/common/Button.stories.jsx

+10
Original file line numberDiff line numberDiff line change
@@ -34,3 +34,13 @@ export const AnchorButton = () => (
3434
export const ReactRouterLink = () => (
3535
<Button to="./somewhere" label="submit">Actually a Link</Button>
3636
);
37+
38+
export const InternalElementMargin = () => (
39+
<Button>
40+
<span>Internal</span>
41+
<span>elements</span>
42+
<span>have</span>
43+
<span>right</span>
44+
<span>margins</span>
45+
</Button>
46+
);

0 commit comments

Comments
 (0)