Skip to content

Commit

Permalink
[Button] Increase elevation on hover when contained (#17537)
Browse files Browse the repository at this point in the history
  • Loading branch information
eps1lon authored and oliviertassinari committed Sep 25, 2019
1 parent 4e88a6c commit d63c8e9
Show file tree
Hide file tree
Showing 3 changed files with 14 additions and 10 deletions.
1 change: 1 addition & 0 deletions docs/src/pages/components/buttons/CustomizedButtons.js
Original file line number Diff line number Diff line change
Expand Up @@ -29,6 +29,7 @@ const BootstrapButton = withStyles({
'&:hover': {
backgroundColor: '#0069d9',
borderColor: '#0062cc',
boxShadow: 'none',
},
'&:active': {
boxShadow: 'none',
Expand Down
1 change: 1 addition & 0 deletions docs/src/pages/components/buttons/CustomizedButtons.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -35,6 +35,7 @@ const BootstrapButton = withStyles({
'&:hover': {
backgroundColor: '#0069d9',
borderColor: '#0062cc',
boxShadow: 'none',
},
'&:active': {
boxShadow: 'none',
Expand Down
22 changes: 12 additions & 10 deletions packages/material-ui/src/Button/Button.js
Original file line number Diff line number Diff line change
Expand Up @@ -110,6 +110,18 @@ export const styles = theme => ({
color: theme.palette.getContrastText(theme.palette.grey[300]),
backgroundColor: theme.palette.grey[300],
boxShadow: theme.shadows[2],
'&:hover': {
backgroundColor: theme.palette.grey.A100,
boxShadow: theme.shadows[4],
// Reset on touch devices, it doesn't add specificity
'@media (hover: none)': {
boxShadow: theme.shadows[2],
backgroundColor: theme.palette.grey[300],
},
'&$disabled': {
backgroundColor: theme.palette.action.disabledBackground,
},
},
'&$focusVisible': {
boxShadow: theme.shadows[6],
},
Expand All @@ -121,16 +133,6 @@ export const styles = theme => ({
boxShadow: theme.shadows[0],
backgroundColor: theme.palette.action.disabledBackground,
},
'&:hover': {
backgroundColor: theme.palette.grey.A100,
// Reset on touch devices, it doesn't add specificity
'@media (hover: none)': {
backgroundColor: theme.palette.grey[300],
},
'&$disabled': {
backgroundColor: theme.palette.action.disabledBackground,
},
},
},
/* Styles applied to the root element if `variant="contained"` and `color="primary"`. */
containedPrimary: {
Expand Down

0 comments on commit d63c8e9

Please sign in to comment.