From 68379680eb3d4ddda81ef81d64fc863e39d5faf2 Mon Sep 17 00:00:00 2001 From: Nathan Marks Date: Sat, 30 Apr 2016 16:45:22 -0400 Subject: [PATCH] [Buttons] Fixed alignment related regressions --- src/FlatButton/FlatButton.js | 3 +-- src/RaisedButton/RaisedButton.js | 2 +- src/internal/EnhancedButton.js | 3 ++- 3 files changed, 4 insertions(+), 4 deletions(-) diff --git a/src/FlatButton/FlatButton.js b/src/FlatButton/FlatButton.js index 0d326d0a1e3788..4b273ce53d1ffb 100644 --- a/src/FlatButton/FlatButton.js +++ b/src/FlatButton/FlatButton.js @@ -202,6 +202,7 @@ class FlatButton extends Component { const mergedRootStyles = Object.assign({}, { height: buttonHeight, + lineHeight: `${buttonHeight}px`, minWidth: buttonMinWidth, color: defaultTextColor, transition: transitions.easeOut(), @@ -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, @@ -241,7 +241,6 @@ class FlatButton extends Component { textTransform: textTransform, fontWeight: fontWeight, fontSize: fontSize, - lineHeight: `${buttonHeight}px`, }, labelStyleIcon, labelStyle); const labelElement = label ? ( diff --git a/src/RaisedButton/RaisedButton.js b/src/RaisedButton/RaisedButton.js index e24dbc43d1862a..888b38dfc2a904 100644 --- a/src/RaisedButton/RaisedButton.js +++ b/src/RaisedButton/RaisedButton.js @@ -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, @@ -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), diff --git a/src/internal/EnhancedButton.js b/src/internal/EnhancedButton.js index 3219634384481b..db3f11c9e724ff 100644 --- a/src/internal/EnhancedButton.js +++ b/src/internal/EnhancedButton.js @@ -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.