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

[Stepper] Add slight transition #22266

Open
Floriferous opened this issue Aug 18, 2020 · 3 comments
Open

[Stepper] Add slight transition #22266

Floriferous opened this issue Aug 18, 2020 · 3 comments

Comments

@Floriferous
Copy link
Contributor

@Floriferous Floriferous commented Aug 18, 2020

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',
      },
    },
@Floriferous
Copy link
Contributor Author

@Floriferous Floriferous commented Aug 18, 2020

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

@oliviertassinari
Copy link
Member

@oliviertassinari oliviertassinari commented Aug 19, 2020

@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,
@oliviertassinari oliviertassinari changed the title [StepIcon] Add slight transition on icon color [Stepper] Add slight transition Aug 19, 2020
@suliskh
Copy link
Contributor

@suliskh suliskh commented Aug 22, 2020

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

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Linked pull requests

Successfully merging a pull request may close this issue.

None yet
3 participants
You can’t perform that action at this time.