[pickers][DateCalendar] Derive the calendar dimensions from - #23258
[pickers][DateCalendar] Derive the calendar dimensions from#23258Syed-Ali-Abbas-Zaidi wants to merge 3 commits into
Conversation
Syed-Ali-Abbas-Zaidi
commented
Jul 30, 2026
- I have followed (at least) the PR section of the contributing guide.
Deploy previewBundle size
Check out the code infra dashboard for more information about this PR. |
|
I've checked-out this branch and resizing looks good 🏆 Question:Why Recommendation:
mui-data-calendar-resize.mp4Would need to replace all |
Thanks for checking out the branch 🙏 Why a fallback instead of a default declarationBecause declaring the variable is what breaks the cascade. Any element that declares Moving that declaration up to the calendar root would only move the problem one level the calendar's declaration would then beat anything you set on a wrapper, in By only ever reading it ( The one real cost is discoverability it won't show up in DevTools computed styles until you set it. The way to get both is to register the property: @property --PickerDay-size {
syntax: "<length>";
inherits: true;
initial-value: 36px;
} |
|
Hi, I saw you ignored my |
noraleonte
left a comment
There was a problem hiding this comment.
Thank you for this — the direction is right, and I want to call out the detail that made it easy to review: deriving the header height and horizontal padding from the existing VIEW_HEIGHT/DIALOG_WIDTH constants, rather than re-deriving the magic numbers by hand. That's what makes the unchanged default rendering provably correct instead of coincidental. 🙏
The constraint we're working under is that this lands in a minor, so it has to be fully non-breaking.
Removing the css vars from the day slots and moving them higher up is a breaking change, and so is making the margin require a unit - even with the updated migration guide.
There's a path could be explored and satisfies both, and it's worth writing down before this gets picked back up. Introduce a new calendar-level token that drives the surrounding dimensions, and keep --PickerDay-size declared on the day sourced from it. Nothing pre-existing changes behavior, and ancestor values still reach the day. Then derive the track from the day size plus a constant 4px rather than from the margin variable — that removes the unit requirement entirely, and costs nothing, since margin 0 already centers a 252px row inside a 320px calendar today.
A good chunk of this survives either way: the MonthCalendar/YearCalendar width change, the skeleton fix, the RANGE_VIEW_HEIGHT cleanup, and the new dimension tests are all keepers.
I'm parking this for now rather than closing it — happy to take it over and build on what's here, or to keep reviewing if you'd like to try another approach yourself. Either way, thanks for digging into this one 💙
|
@noraleonte Thank you for the detailed review. I have opened a separate PR keeping in mind the things you mentioned. |