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

Closed
Floriferous opened this issue Aug 18, 2020 · 6 comments · Fixed by #22654
Closed

[Stepper] Add slight transition #22266

Floriferous opened this issue Aug 18, 2020 · 6 comments · Fixed by #22654
Assignees
Labels
component: stepper This is the name of the generic UI component, not the React module! good first issue Great for first contributions. Enable to learn the contribution process. new feature New feature or request

Comments

@Floriferous
Copy link
Contributor

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 Floriferous added the status: waiting for maintainer These issues haven't been looked at yet by a maintainer label Aug 18, 2020
@Floriferous
Copy link
Contributor Author

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

@oliviertassinari oliviertassinari added the component: stepper This is the name of the generic UI component, not the React module! label Aug 19, 2020
@oliviertassinari
Copy link
Member

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 added good first issue Great for first contributions. Enable to learn the contribution process. and removed status: waiting for maintainer These issues haven't been looked at yet by a maintainer labels Aug 19, 2020
@oliviertassinari oliviertassinari changed the title [StepIcon] Add slight transition on icon color [Stepper] Add slight transition Aug 19, 2020
@oliviertassinari oliviertassinari added the new feature New feature or request label Aug 19, 2020
@suliskh

This comment has been minimized.

@lfp2
Copy link

lfp2 commented Sep 8, 2020

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

@oliviertassinari
Copy link
Member

@lfp2 Sure :)

@xtrixia
Copy link
Contributor

xtrixia commented Sep 19, 2020

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

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
component: stepper This is the name of the generic UI component, not the React module! good first issue Great for first contributions. Enable to learn the contribution process. new feature New feature or request
Projects
None yet
Development

Successfully merging a pull request may close this issue.

5 participants