Material-ui: [Stepper] Add slight transition

Created on 18 Aug 2020  路  6Comments  路  Source: mui-org/material-ui

I'm not sure what the policy on css transitions is in this repo, but here's a suggestion.

I noticed that color transitions on the StepIcon component are instantaneous, even though the entire component is quite animated and fluid. The StepIcon goes through several colors (default -> active -> completed), and I believe a simple transition: color 300ms ease; already adds quite a bit more style to it.

Transition variables to be determined by the theme of course. It could be the same as the transition of the Collapse?

Here's the change that would need to be made:

    MuiStepIcon: {
      root: {
        transition: 'color 300ms ease',
      },
    },
Stepper enhancement good first issue

Most helpful comment

Hi 馃憢 If no one work on this, I'd love to help on this one :)

All 6 comments

Similarly, for the MobileStepper, the dot version could also use a slight bit of animation.

@Floriferous This sounds like a great idea. I have seen Ant Design, Elastic UI behave similarly. Would this diff cover your use case?

diff --git a/packages/material-ui/src/MobileStepper/MobileStepper.js b/packages/material-ui/src/MobileStepper/MobileStepper.js
index b9a8f7a5b2..d1e62e31d9 100644
--- a/packages/material-ui/src/MobileStepper/MobileStepper.js
+++ b/packages/material-ui/src/MobileStepper/MobileStepper.js
@@ -41,6 +41,7 @@ export const styles = (theme) => ({
   },
   /* Styles applied to each dot if `variant="dots"`. */
   dot: {
+    transition: theme.transitions.create('background-color'),
     backgroundColor: theme.palette.action.disabled,
     borderRadius: '50%',
     width: 8,
diff --git a/packages/material-ui/src/StepIcon/StepIcon.js b/packages/material-ui/src/StepIcon/StepIcon.js
index 9e1aaeedac..0dcd3dc1d1 100644
--- a/packages/material-ui/src/StepIcon/StepIcon.js
+++ b/packages/material-ui/src/StepIcon/StepIcon.js
@@ -11,6 +11,7 @@ export const styles = (theme) => ({
   root: {
     display: 'block',
     color: theme.palette.text.disabled,
+    transition: theme.transitions.create('color'),
     '&$completed': {
       color: theme.palette.primary.main,
     },
diff --git a/packages/material-ui/src/StepLabel/StepLabel.js b/packages/material-ui/src/StepLabel/StepLabel.js
index 4a0a857af5..960c9efe68 100644
--- a/packages/material-ui/src/StepLabel/StepLabel.js
+++ b/packages/material-ui/src/StepLabel/StepLabel.js
@@ -28,6 +28,7 @@ export const styles = (theme) => ({
   },
   /* Styles applied to the `Typography` component which wraps `children`. */
   label: {
+    transition: theme.transitions.create('color'),
     '&$active': {
       color: theme.palette.text.primary,
       fontWeight: 500,

If that's okay, could I add this as a PR?

Hi, I can give a try on this? :)

@lfp2 Sure :)

Hi 馃憢 If no one work on this, I'd love to help on this one :)

Was this page helpful?
0 / 5 - 0 ratings

Related issues

zabojad picture zabojad  路  3Comments

ghost picture ghost  路  3Comments

activatedgeek picture activatedgeek  路  3Comments

revskill10 picture revskill10  路  3Comments

chris-hinds picture chris-hinds  路  3Comments