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

[material-ui][Stepper] Not generating a utility class for nonLinear #42360

Closed
alexismo opened this issue May 23, 2024 · 4 comments · Fixed by #42620
Closed

[material-ui][Stepper] Not generating a utility class for nonLinear #42360

alexismo opened this issue May 23, 2024 · 4 comments · Fixed by #42620
Assignees
Labels
component: stepper This is the name of the generic UI component, not the React module! enhancement This is not a bug, nor a new feature package: material-ui Specific to @mui/material

Comments

@alexismo
Copy link
Contributor

alexismo commented May 23, 2024

Summary

When using <Stepper nonLinear Stepper's html markup does not gain a MuiStepper-nonLinear class. When used along with alternativeLabel, making it disproportionately difficult to style StepButton differently based on the nonLinear prop.

I acknowledge this issue resembles #17367. We are trying to target the styles of StepConnector without providing a custom implementation of StepConnector.

Examples

image

Motivation

For our nonLinear Stepper, since the Steps do not represent linear progression, we want to style Steps in a way where they appear related to each other and where each Step is not dependent on the previous steps.

Search keywords: stepper nonLinear utilityClass utility class

@alexismo alexismo added the status: waiting for maintainer These issues haven't been looked at yet by a maintainer label May 23, 2024
@zannager zannager added the component: stepper This is the name of the generic UI component, not the React module! label May 23, 2024
@DiegoAndai
Copy link
Member

Hey @alexismo, thanks for the report! I understand the issue but could you provide a minimal reproduction? This would help us understand the use case better. A live example would be perfect. This StackBlitz sandbox template may be a good starting point. Thank you!

@DiegoAndai DiegoAndai added status: waiting for author Issue with insufficient information and removed status: waiting for maintainer These issues haven't been looked at yet by a maintainer labels May 23, 2024
@alexismo
Copy link
Contributor Author

alexismo commented May 24, 2024

@github-actions github-actions bot added status: waiting for maintainer These issues haven't been looked at yet by a maintainer and removed status: waiting for author Issue with insufficient information labels May 24, 2024
@danilo-leal danilo-leal changed the title Stepper does not generate a utility class for nonLinear [material-ui][Stepper] Not generating a utility class for nonLinear May 28, 2024
@danilo-leal danilo-leal added the package: material-ui Specific to @mui/material label May 28, 2024
@alexismo
Copy link
Contributor Author

alexismo commented Jun 4, 2024

@danilo-leal should I wait for the maintainer's response before submitting a PR to material-ui?

@ZeeshanTamboli
Copy link
Member

I think we can add this class. @alexismo, feel free to create a PR; I'll mark it as an enhancement.

You can also use theme variants:

const theme = createTheme({
  components: {
    MuiStep: {
      styleOverrides: {
        root: {
          '&[class*="Mui-completed"]': {
            '& [class*="MuiStepConnector-line"]': {
              borderColor: 'green',
              borderWidth: '3px',
            },
          },
        },
      },
    },
    MuiStepConnector: {
      styleOverrides: {
        line: {
          borderWidth: '2px',
          borderColor: 'darkgrey',
        },
      },
    },
    MuiStepper: {
      variants: [
        {
          props: { nonLinear: true },
          style: {
            border: '2px solid red',
          },
        },
      ],
    },
  },
});

However, if I understood your use case correctly, if you want to target individual steps in a non-linear stepper, the above theme variants won't work.

@ZeeshanTamboli ZeeshanTamboli added enhancement This is not a bug, nor a new feature and removed status: waiting for maintainer These issues haven't been looked at yet by a maintainer labels Jun 10, 2024
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! enhancement This is not a bug, nor a new feature package: material-ui Specific to @mui/material
Projects
None yet
Development

Successfully merging a pull request may close this issue.

5 participants