Skip to content

Conversation

tyalau
Copy link

@tyalau tyalau commented Aug 4, 2025

Closes #46639

Summary

This PR updates the logic to use a pure CSS approach by leveraging the :has() and :not() selectors. The ::before styling is now applied only when .MuiTimelineOppositeContent-root is not present within a TimelineItem.

This ensures consistent layout behavior regardless of whether TimelineItem is used in a Server or Client Component.

useEffect() is used to check children after hydration and set hasOppositeContent accordingly, which is then used to conditionally apply the missingOppositeContent class.

@mui-bot
Copy link

mui-bot commented Aug 4, 2025

Netlify deploy preview

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

Bundle size report

Bundle Parsed Size Gzip Size
@mui/material 0B(0.00%) 0B(0.00%)
@mui/lab 🔺+30B(+0.02%) 🔺+16B(+0.04%)
@mui/system 0B(0.00%) 0B(0.00%)
@mui/utils 0B(0.00%) 0B(0.00%)

Details of bundle changes

Generated by 🚫 dangerJS against 0a3eb16

@tyalau tyalau force-pushed the fix/timelineitem-extra-space branch 2 times, most recently from 0536f73 to 505434c Compare August 4, 2025 14:32
@zannager zannager added the scope: timeline Changes related to the timeline. label Aug 4, 2025
@zannager zannager requested a review from siriwatknp August 4, 2025 14:34
@ZeeshanTamboli ZeeshanTamboli added breaking change Introduces changes that are not backward compatible. v8.x labels Aug 6, 2025
@tyalau tyalau force-pushed the fix/timelineitem-extra-space branch from 505434c to f760873 Compare August 8, 2025 02:55
@ZeeshanTamboli ZeeshanTamboli changed the title [material-ui] [TimelineItem] Fix extra ::before spacing when TimelineOppositeContent is present [material-ui][TimelineItem] Fix extra ::before spacing when TimelineOppositeContent is present Aug 9, 2025
@tyalau tyalau force-pushed the fix/timelineitem-extra-space branch from f760873 to 0a3eb16 Compare August 11, 2025 07:13
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
breaking change Introduces changes that are not backward compatible. scope: timeline Changes related to the timeline. v8.x
Projects
None yet
Development

Successfully merging this pull request may close these issues.

[TimelineItem] Extra space due to ::before even when TimelineOppositeContent is present
4 participants