Skip to content

Commit 2884b07

Browse files
Merge pull request mui#4754 from TristanJMcCormick/FlatButton-icon-styling
[FlatButton] Merge styles prop for FontIcon node
2 parents e73263b + f13a0ed commit 2884b07

1 file changed

Lines changed: 6 additions & 5 deletions

File tree

src/FlatButton/FlatButton.js

Lines changed: 6 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -213,13 +213,14 @@ class FlatButton extends Component {
213213
const labelStyleIcon = {};
214214

215215
if (icon) {
216+
const iconStyles = Object.assign({
217+
verticalAlign: 'middle',
218+
marginLeft: label && labelPosition !== 'before' ? 12 : 0,
219+
marginRight: label && labelPosition === 'before' ? 12 : 0,
220+
}, icon.props.style);
216221
iconCloned = React.cloneElement(icon, {
217222
color: icon.props.color || mergedRootStyles.color,
218-
style: {
219-
verticalAlign: 'middle',
220-
marginLeft: label && labelPosition !== 'before' ? 12 : 0,
221-
marginRight: label && labelPosition === 'before' ? 12 : 0,
222-
},
223+
style: iconStyles,
223224
});
224225

225226
if (labelPosition === 'before') {

0 commit comments

Comments
 (0)