Skip to content

Commit

Permalink
[Button] Improve loading transition
Browse files Browse the repository at this point in the history
  • Loading branch information
oliviertassinari committed Oct 4, 2020
1 parent 4824c9e commit fda0c7b
Show file tree
Hide file tree
Showing 4 changed files with 12 additions and 6 deletions.
2 changes: 1 addition & 1 deletion docs/src/pages/components/switches/CustomizedSwitches.js
Original file line number Diff line number Diff line change
Expand Up @@ -56,7 +56,7 @@ const IOSSwitch = withStyles((theme) => ({
border: `1px solid ${theme.palette.grey[400]}`,
backgroundColor: theme.palette.grey[50],
opacity: 1,
transition: theme.transitions.create(['background-color', 'border']),
transition: theme.transitions.create(['background-color', 'border-color']),
},
checked: {},
focusVisible: {},
Expand Down
5 changes: 4 additions & 1 deletion docs/src/pages/components/switches/CustomizedSwitches.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -72,7 +72,10 @@ const IOSSwitch = withStyles((theme: Theme) =>
border: `1px solid ${theme.palette.grey[400]}`,
backgroundColor: theme.palette.grey[50],
opacity: 1,
transition: theme.transitions.create(['background-color', 'border']),
transition: theme.transitions.create([
'background-color',
'border-color',
]),
},
checked: {},
focusVisible: {},
Expand Down
9 changes: 6 additions & 3 deletions packages/material-ui/src/Button/Button.js
Original file line number Diff line number Diff line change
Expand Up @@ -14,9 +14,12 @@ export const styles = (theme) => ({
minWidth: 64,
padding: '6px 16px',
borderRadius: theme.shape.borderRadius,
transition: theme.transitions.create(['background-color', 'box-shadow', 'border'], {
duration: theme.transitions.duration.short,
}),
transition: theme.transitions.create(
['background-color', 'box-shadow', 'border-color', 'color'],
{
duration: theme.transitions.duration.short,
},
),
'&:hover': {
textDecoration: 'none',
backgroundColor: fade(theme.palette.text.primary, theme.palette.action.hoverOpacity),
Expand Down
2 changes: 1 addition & 1 deletion packages/material-ui/src/Fab/Fab.js
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@ export const styles = (theme) => ({
root: {
...theme.typography.button,
minHeight: 36,
transition: theme.transitions.create(['background-color', 'box-shadow', 'border'], {
transition: theme.transitions.create(['background-color', 'box-shadow', 'border-color'], {
duration: theme.transitions.duration.short,
}),
borderRadius: '50%',
Expand Down

0 comments on commit fda0c7b

Please sign in to comment.