Skip to content

Commit

Permalink
Merge pull request mui#3988 from echenley/bugfix/raised-button-font-size
Browse files Browse the repository at this point in the history
[RaisedButton] Respect theme fontSize
  • Loading branch information
mbrookes committed May 12, 2016
2 parents 2feb02a + 54d8223 commit 8c0ec6f
Show file tree
Hide file tree
Showing 3 changed files with 14 additions and 1 deletion.
2 changes: 1 addition & 1 deletion src/RaisedButton/RaisedButton.js
Original file line number Diff line number Diff line change
Expand Up @@ -78,7 +78,7 @@ function getStyles(props, context, state) {
label: {
position: 'relative',
opacity: 1,
fontSize: '14px',
fontSize: raisedButton.fontSize,
letterSpacing: 0,
textTransform: raisedButton.textTransform || button.textTransform || 'uppercase',
fontWeight: raisedButton.fontWeight,
Expand Down
12 changes: 12 additions & 0 deletions src/RaisedButton/RaisedButton.spec.js
Original file line number Diff line number Diff line change
Expand Up @@ -91,4 +91,16 @@ describe('<RaisedButton />', () => {
);
});
});

it('inherits fontSize from theme', () => {
const wrapper = shallowWithContext(
<RaisedButton label="test" />
);

assert.strictEqual(wrapper.contains('test'), true);
assert.equal(
wrapper.find('[children="test"]').prop('style').fontSize,
muiTheme.raisedButton.fontSize
);
});
});
1 change: 1 addition & 0 deletions src/styles/getMuiTheme.js
Original file line number Diff line number Diff line change
Expand Up @@ -189,6 +189,7 @@ export default function getMuiTheme(muiTheme, ...more) {
secondaryTextColor: palette.alternateTextColor,
disabledColor: darken(palette.alternateTextColor, 0.1),
disabledTextColor: fade(palette.textColor, 0.3),
fontSize: typography.fontStyleButtonFontSize,
fontWeight: typography.fontWeightMedium,
},
refreshIndicator: {
Expand Down

0 comments on commit 8c0ec6f

Please sign in to comment.