Skip to content

Commit

Permalink
Merge pull request #4130 from nathanmarks/button-label-alignment
Browse files Browse the repository at this point in the history
[Buttons] Fixed alignment related regressions
  • Loading branch information
newoga committed Apr 30, 2016
2 parents 66417b7 + 6837968 commit 5986091
Show file tree
Hide file tree
Showing 3 changed files with 4 additions and 4 deletions.
3 changes: 1 addition & 2 deletions src/FlatButton/FlatButton.js
Original file line number Diff line number Diff line change
Expand Up @@ -202,6 +202,7 @@ class FlatButton extends Component {

const mergedRootStyles = Object.assign({}, {
height: buttonHeight,
lineHeight: `${buttonHeight}px`,
minWidth: buttonMinWidth,
color: defaultTextColor,
transition: transitions.easeOut(),
Expand All @@ -222,7 +223,6 @@ class FlatButton extends Component {
iconCloned = React.cloneElement(icon, {
color: mergedRootStyles.color,
style: {
lineHeight: `${buttonHeight}px`,
verticalAlign: 'middle',
marginLeft: label && labelPosition !== 'before' ? 12 : 0,
marginRight: label && labelPosition === 'before' ? 12 : 0,
Expand All @@ -241,7 +241,6 @@ class FlatButton extends Component {
textTransform: textTransform,
fontWeight: fontWeight,
fontSize: fontSize,
lineHeight: `${buttonHeight}px`,
}, labelStyleIcon, labelStyle);

const labelElement = label ? (
Expand Down
2 changes: 1 addition & 1 deletion src/RaisedButton/RaisedButton.js
Original file line number Diff line number Diff line change
Expand Up @@ -66,6 +66,7 @@ function getStyles(props, context, state) {
position: 'relative',
minWidth: fullWidth ? '100%' : button.minWidth,
height: buttonHeight,
lineHeight: `${buttonHeight}px`,
width: '100%',
padding: 0,
borderRadius: borderRadius,
Expand Down Expand Up @@ -94,7 +95,6 @@ function getStyles(props, context, state) {
},
overlay: {
height: buttonHeight,
lineHeight: `${buttonHeight}px`,
borderRadius: borderRadius,
backgroundColor: (state.keyboardFocused || state.hovered) && !disabled &&
fade(labelColor, amount),
Expand Down
3 changes: 2 additions & 1 deletion src/internal/EnhancedButton.js
Original file line number Diff line number Diff line change
Expand Up @@ -274,7 +274,8 @@ class EnhancedButton extends Component {
cursor: disabled ? 'default' : 'pointer',
textDecoration: 'none',
outline: 'none',
font: 'inherit',
fontSize: 'inherit',
fontWeight: 'inherit',
/**
* This is needed so that ripples do not bleed
* past border radius.
Expand Down

0 comments on commit 5986091

Please sign in to comment.