Skip to content

Commit 8c0ec6f

Browse files
committed
Merge pull request mui#3988 from echenley/bugfix/raised-button-font-size
[RaisedButton] Respect theme fontSize
2 parents 2feb02a + 54d8223 commit 8c0ec6f

3 files changed

Lines changed: 14 additions & 1 deletion

File tree

src/RaisedButton/RaisedButton.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -78,7 +78,7 @@ function getStyles(props, context, state) {
7878
label: {
7979
position: 'relative',
8080
opacity: 1,
81-
fontSize: '14px',
81+
fontSize: raisedButton.fontSize,
8282
letterSpacing: 0,
8383
textTransform: raisedButton.textTransform || button.textTransform || 'uppercase',
8484
fontWeight: raisedButton.fontWeight,

src/RaisedButton/RaisedButton.spec.js

Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -91,4 +91,16 @@ describe('<RaisedButton />', () => {
9191
);
9292
});
9393
});
94+
95+
it('inherits fontSize from theme', () => {
96+
const wrapper = shallowWithContext(
97+
<RaisedButton label="test" />
98+
);
99+
100+
assert.strictEqual(wrapper.contains('test'), true);
101+
assert.equal(
102+
wrapper.find('[children="test"]').prop('style').fontSize,
103+
muiTheme.raisedButton.fontSize
104+
);
105+
});
94106
});

src/styles/getMuiTheme.js

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -189,6 +189,7 @@ export default function getMuiTheme(muiTheme, ...more) {
189189
secondaryTextColor: palette.alternateTextColor,
190190
disabledColor: darken(palette.alternateTextColor, 0.1),
191191
disabledTextColor: fade(palette.textColor, 0.3),
192+
fontSize: typography.fontStyleButtonFontSize,
192193
fontWeight: typography.fontWeightMedium,
193194
},
194195
refreshIndicator: {

0 commit comments

Comments
 (0)