Skip to content

Commit

Permalink
[StepButton] Support vertical stepper (#10698)
Browse files Browse the repository at this point in the history
* [StepButton] justify content left

This will render the children/StepLabel correct in a vertical Stepper

* fix visual diff
  • Loading branch information
danieljuhl authored and oliviertassinari committed Mar 18, 2018
1 parent a712517 commit 879ab60
Show file tree
Hide file tree
Showing 2 changed files with 11 additions and 1 deletion.
1 change: 1 addition & 0 deletions pages/api/step-button.md
Expand Up @@ -23,6 +23,7 @@ Any other properties supplied will be [spread to the root element](/guides/api#s
You can override all the class names injected by Material-UI thanks to the `classes` property.
This property accepts the following keys:
- `root`
- `vertical`
- `touchRipple`

Have a look at [overriding with classes](/customization/overrides#overriding-with-classes) section
Expand Down
11 changes: 10 additions & 1 deletion src/Stepper/StepButton.js
Expand Up @@ -15,6 +15,9 @@ export const styles = theme => ({
margin: `${-theme.spacing.unit * 3}px ${-theme.spacing.unit * 2}px`,
boxSizing: 'content-box',
},
vertical: {
justifyContent: 'left',
},
touchRipple: {
color: 'rgba(0, 0, 0, 0.3)',
},
Expand Down Expand Up @@ -55,7 +58,13 @@ function StepButton(props) {
<ButtonBase
disabled={disabled}
TouchRippleProps={{ className: classes.touchRipple }}
className={classNames(classes.root, classNameProp)}
className={classNames(
classes.root,
{
[classes.vertical]: orientation === 'vertical',
},
classNameProp,
)}
{...other}
>
{child}
Expand Down

0 comments on commit 879ab60

Please sign in to comment.