Repository navigation
Calendar: Fill the available container width - #86086
Conversation
🤖 PR meta 🤖🎉 PropsIf you're merging code through a pull request on GitHub, copy and paste the following into the bottom of the merge commit message. To understand the WordPress project's expectations around crediting contributors, please review the Contributor Attribution page in the Core Handbook. Props Bot commandsYou can trigger Props Bot actions by commenting on this PR:
Updated as activity occurs, without notifying anyone named here. Add the 📦 Bundle sizeSize Change: -318 B (0%) Total Size: 8.63 MB 📦 View Changed
⚡ PerformanceShow the resultsClient side metrics exclude the server response time. front-end-block-theme
front-end-classic-theme
media-processing
media-upload
post-editor
site-editor
🏁 Flaky testsSome tests passed with failed attempts. The failures may not be related to this commit but are still reported for visibility. See the documentation for more information. As a user I expect my navigation to use the colors I selected for it in
|
|
Seems good. I guess it also goes in the other direction, squishing if it grows smaller. But perhaps the main container has a min-width here. |
|
We can look into whether it's possible to squish it to a lower min width than the current one, but I feel like that's a lower priority (I'd prefer to keep this PR focused and shippable quick) |
mirka
left a comment
There was a problem hiding this comment.
Was this design considered with the current day marker in mind? I don't see a single screenshot for that so I'm not sure. I don't think the the current day marker design (small dot on the top right corner) works with anything other than a tight square.
|
FWIW, since we've added custom edit controls for the date fields (not using the bundled There's stories that highlight this usage (e.g., DataForm regular layout, datetime field) — perhaps the best one is the validation story with panel layout (date fields):
|
1e3d1f4 to
11b2ba2
Compare
* Calendar: Fill the available container width * Calendar: Document fluid sizing in the changelog * Calendar: Preserve minimum widths in content-sized containers * Calendar: Preserve stretched widths during month navigation * Calendar: Remove redundant layout and SVG declarations * Calendar: Keep today markers beside dates at fluid widths --- Co-authored-by: ciampo <mciampini@git.wordpress.org> Co-authored-by: jorgefilipecosta <jorgefilipecosta@git.wordpress.org> Co-authored-by: mirka <0mirka00@git.wordpress.org> Co-authored-by: jasmussen <joen@git.wordpress.org> Co-authored-by: oandregal <oandregal@git.wordpress.org>



See #85933 for the related square-day approach. Custom day highlighting and its relationship to the today indicator are tracked separately in #86538.
What?
Make
CalendarandRangeCalendarfill their container, with a default minimum of 224px per month and no maximum. Use a fixed-width orwidth: fit-contentwrapper for a compact calendar.Why?
The fixed-width grids leave unused space in wider containers.
How?
Months share each row equally and wrap when needed. An incomplete last row also fills its width. Days stay 32px high. The range preview SVG resizes without stretching its stroke, dashes, or corners. The today dot stays beside the centered date number as the cell widens, including in selected and range states. Its position at the minimum width is unchanged.
The dot stays close to the number because an unselected day has no visible button boundary. Anchoring it to the far corner of a wide cell separates it from the date. Both Fluid Width stories now show the current month so this can be checked while resizing.
Testing Instructions
resetOnSelect: trueand ranges crossing months.width: fit-contentwrapper or content-sized UI Popover. Expect 224px, 464px, or 704px for one, two, or three months when space allows. Below 224px, the parent controls scrolling or clipping.Testing Instructions for Keyboard
Tab through the navigation buttons into the grid. Use arrow keys to move and Enter or Space to select. The focus ring should cover the stretched day button, including after wrapping.
Verification and limits
At
11b2ba2e2e2, build, lint, UI types, and all 227 calendar and DataForm datetime tests passed, including 20 browser tests. The latest visual checks covered the today marker, wide range previews in LTR and RTL, and all three linked DataForm examples in Chromium and WebKit. In the regular layout, calendar and input borders both measured 868px at a 900px viewport and 343px at a 375px viewport. The datetime editor calendar fit its approximately 243px column. The validation popup had no horizontal overflow at either viewport width; its longer content scrolled vertically, and date selection updated the datetime input.Earlier checks covered month navigation and content-sized UI Popovers. Firefox, editor integration, and screen-reader testing remain unverified. This PR changes calendar sizing and the position of the existing today dot. It does not add post/event indicators or settle their design; that work remains in #86538.
Screenshots or screencast
Today marker
Captured on 9 November 2026 at
11b2ba2e2e2, in Chromium with the light theme. The date is 9 November. Day buttons stay 32px high as they widen.At 700px, each day button is 100px wide and 32px high. Selection and keyboard focus cover that full width; the dot stays beside the number.
The same placement applies to RangeCalendar, including selected endpoints and the dashed hover preview.
DataForm visual checks
Captured at
11b2ba2e2e2in Chromium. The same layout checks passed in WebKit. These screenshots show the shared DataForm controls; they do not show the custom post-date control restored in #86065.Regular layout, DateTime field at a 900px viewport. The input border and calendar both fill 868px. The very wide day buttons are intentional; consumers can constrain their container for a compact calendar.
The same field at a 375px viewport. The input and calendar both fill 343px.
Datetime field story, with the selected item open for editing. The calendar fits the approximately 243px editing column and aligns with the input above it.
Validation story, Date fields popup. This capture uses a 900×1800 viewport to show all three calendars together. At shorter heights, the popup scrolls vertically.
The same popup at a 375×1000 viewport. Its calendars fit without horizontal clipping.
Earlier before/after layout comparisons
These captures document the earlier revisions named below. The current today-marker and DataForm screenshots above supersede them for those states.
Before:
aad2cfbc3bb. After:1e3d1f4054f. Captured in Chromium with the light theme. Each pair uses the same container width, dates, hover, and keyboard focus.Calendar, one month at 448px
Before
After
RangeCalendar, two months at 928px
Before
After
RangeCalendar, two wrapped months at 348px
Before
After
More states
Captured at
1e3d1f4054f. Selected dates appear above hover and focus states. Navigation frames are paused at 35%.Calendar, one month
Calendar, two months
RangeCalendar, one month
RangeCalendar, two months
Additional states
Compact popovers and navigation
Use of AI Tools
Implemented and checked with OpenAI Codex.