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][Divider] To propose usability improvements for Divider component when has children. #42596

Closed

Conversation

appleSimple
Copy link
Contributor

fixes #42569

If Divider component has children, rendered using 'div' tag but border style actually in pseudo elements(::befote, ::after)
So custom style applied only div tag like below.

const StyledDivider = styled(Divider)(({}) => ({
  "&::before": {
    width: "3.75rem",
    flex: "0 0 3.75rem",
  },
  borderStyle: `dashed`, // this is apply only 'div'
}));

If we want to use it immediately, use this way.

but someone don't know border "top" style, or border "bottom" style ~ whatever.
This PR simply requires writing "borderStyle" in the pseudo-element.

example

const StyledDivider = styled(Divider)(({}) => ({
  "&::before": {
    width: "3.75rem",
    flex: "0 0 3.75rem",
    borderStyle: `dashed`
  },
  "&::after": {
    borderStyle: `dashed`
  },
}));

Thanks for read!

@mui-bot
Copy link

mui-bot commented Jun 10, 2024

Netlify deploy preview

https://deploy-preview-42596--material-ui.netlify.app/

Bundle size report

Details of bundle changes (Toolpad)
Details of bundle changes

Generated by 🚫 dangerJS against 461e9a8

@zannager zannager added component: divider This is the name of the generic UI component, not the React module! package: material-ui Specific to @mui/material labels Jun 10, 2024
@zannager zannager requested a review from DiegoAndai June 10, 2024 11:35
@DiegoAndai
Copy link
Member

DiegoAndai commented Jun 14, 2024

Hey @appleSimple! Thanks for working on this.

I think the change does not fix the issue, though. Here's a condesandbox using this PR's build, you can see that the issue is still present: https://codesandbox.io/p/sandbox/pr-42596-1-w7fd9h

@appleSimple
Copy link
Contributor Author

@DiegoAndai
Thank you for your reply.
yeah, I think so and unfortunately this PR should be rejected or closed. 😂
Can I close it?

@DiegoAndai
Copy link
Member

DiegoAndai commented Jun 18, 2024

Can I close it?

Sure, if you don't plan to work on it feel free to close it, I'll mark the issue as ready to take 😊

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
component: divider This is the name of the generic UI component, not the React module! package: material-ui Specific to @mui/material
Projects
None yet
Development

Successfully merging this pull request may close these issues.

[material-ui][Divider] dashed borderStyle does not work for Divider with text
4 participants