Skip to content

Commit

Permalink
theme-aware-outlined-button
Browse files Browse the repository at this point in the history
  • Loading branch information
essuraj authored and oliviertassinari committed Aug 12, 2018
1 parent 20ad6da commit 2e45286
Showing 1 changed file with 11 additions and 1 deletion.
12 changes: 11 additions & 1 deletion packages/material-ui/src/Button/Button.js
Original file line number Diff line number Diff line change
Expand Up @@ -76,7 +76,7 @@ export const styles = theme => ({
flatSecondary: {},
/* Styles applied to the root element if `variant="outlined"`. */
outlined: {
border: `1px solid ${
border: `2px solid ${
theme.palette.type === 'light' ? 'rgba(0, 0, 0, 0.23)' : 'rgba(255, 255, 255, 0.23)'
}`,
},
Expand Down Expand Up @@ -131,6 +131,14 @@ export const styles = theme => ({
},
},
},
/* Styles applied to the root element if `variant="[contained | fab]"` and `color="primary"`. */
outlinedPrimary: {
border: `2px solid ${theme.palette.primary.main}`,
},
/* Styles applied to the root element if `variant="[contained | fab]"` and `color="secondary"`. */
outlinedSecondary: {
border: `2px solid ${theme.palette.secondary.main}`,
},
/* Styles applied to the root element for backwards compatibility with legacy variant naming. */
raised: {}, // legacy
/* Styles applied to the root element for backwards compatibility with legacy variant naming. */
Expand Down Expand Up @@ -228,6 +236,8 @@ function Button(props) {
[classes.raisedPrimary]: (contained || fab) && color === 'primary',
[classes.raisedSecondary]: (contained || fab) && color === 'secondary',
[classes.outlined]: variant === 'outlined',
[classes.outlinedPrimary]: variant === 'outlined' && color === 'primary',
[classes.outlinedSecondary]: variant === 'outlined' && color === 'secondary',
[classes[`size${capitalize(size)}`]]: size !== 'medium',
[classes.disabled]: disabled,
[classes.fullWidth]: fullWidth,
Expand Down

0 comments on commit 2e45286

Please sign in to comment.