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] borderStyle enhancement in divider with children #42715

Open
wants to merge 2 commits into
base: next
Choose a base branch
from

Conversation

anuujj
Copy link
Contributor

@anuujj anuujj commented Jun 22, 2024

fixes #42569

@anuujj anuujj changed the title [material-ui] [Divider] borderStyle enhancement in divider with children [material-ui][Divider] borderStyle enhancement in divider with children Jun 22, 2024
@@ -137,6 +137,8 @@ const DividerRoot = styled('div', {
whiteSpace: 'nowrap',
textAlign: 'center',
border: 0,
borderTopStyle: 'solid',
Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

this change sets the default border style, that can be inherited by before and after pseudo-elements.

Copy link
Member

@DiegoAndai DiegoAndai Jun 27, 2024

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

What happens if we remove these? Isn't line 61 above enough to set the default to be inherited?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

In our case (divider with children), the border-style is being inherited from Line 139, not from Line 61. Line 139, border : 0 sets the border-style to none, which will remove the border. Hence, the need to explicitly add border styling.

@mui-bot
Copy link

mui-bot commented Jun 22, 2024

Netlify deploy preview

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

Bundle size report

Details of bundle changes (Toolpad)
Details of bundle changes

Generated by 🚫 dangerJS against 088f128

@anuujj anuujj marked this pull request as ready for review June 22, 2024 22:59
@zannager zannager added the component: divider This is the name of the generic UI component, not the React module! label Jun 24, 2024
@zannager zannager requested a review from DiegoAndai June 24, 2024 13:23
Copy link
Member

@DiegoAndai DiegoAndai left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks for working on this @anuujj! I left a question.

The solution is working as expected: https://codesandbox.io/p/sandbox/pr-42715-1-pyqg9y

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!
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