Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[Button] Fix vertical alignment of text #14051

Merged
merged 3 commits into from
Jan 2, 2019
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions docs/src/pages/demos/buttons/CustomizedButtons.js
Original file line number Diff line number Diff line change
Expand Up @@ -23,6 +23,7 @@ const styles = theme => ({
fontSize: 16,
padding: '6px 12px',
border: '1px solid',
lineHeight: 1.5,
backgroundColor: '#007bff',
borderColor: '#007bff',
fontFamily: [
Expand Down
6 changes: 2 additions & 4 deletions packages/material-ui/src/Button/Button.js
Original file line number Diff line number Diff line change
Expand Up @@ -12,11 +12,10 @@ import { capitalize } from '../utils/helpers';
export const styles = theme => ({
/* Styles applied to the root element. */
root: {
lineHeight: 1.3125, // To remove with v4.
lineHeight: 1.75, // To remove with v4.
...theme.typography.button,
boxSizing: 'border-box',
minWidth: 64,
minHeight: 36,
padding: '6px 16px',
borderRadius: theme.shape.borderRadius,
color: theme.palette.text.primary,
Expand Down Expand Up @@ -79,6 +78,7 @@ export const styles = theme => ({
flatSecondary: {},
/* Styles applied to the root element if `variant="outlined"`. */
outlined: {
padding: '5px 16px',
border: `1px solid ${
theme.palette.type === 'light' ? 'rgba(0, 0, 0, 0.23)' : 'rgba(255, 255, 255, 0.23)'
}`,
Expand Down Expand Up @@ -209,13 +209,11 @@ export const styles = theme => ({
sizeSmall: {
padding: '4px 8px',
minWidth: 64,
minHeight: 31,
fontSize: theme.typography.pxToRem(13),
},
/* Styles applied to the root element if `size="large"`. */
sizeLarge: {
padding: '8px 24px',
minHeight: 42,
fontSize: theme.typography.pxToRem(15),
},
/* Styles applied to the root element if `fullWidth={true}`. */
Expand Down
2 changes: 1 addition & 1 deletion packages/material-ui/src/styles/createTypography.js
Original file line number Diff line number Diff line change
Expand Up @@ -71,7 +71,7 @@ export default function createTypography(palette, typography) {
subtitle2: buildVariant(fontWeightMedium, 14, 1.57, 0.1),
body1Next: buildVariant(fontWeightRegular, 16, 1.5, 0.15),
body2Next: buildVariant(fontWeightRegular, 14, 1.5, 0.15),
buttonNext: buildVariant(fontWeightMedium, 14, 1.3125, 0.4, caseAllCaps),
buttonNext: buildVariant(fontWeightMedium, 14, 1.75, 0.4, caseAllCaps),
captionNext: buildVariant(fontWeightRegular, 12, 1.66, 0.4),
overline: buildVariant(fontWeightRegular, 12, 2.66, 1, caseAllCaps),
};
Expand Down