Components: Add styles for outside days in Calendar components#76199
Conversation
|
The following accounts have interacted with this PR and/or linked issues. I will continue to update these lists as activity occurs. You can also manually ask me to refresh this list by adding the If 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. |
184b4a6 to
22a28be
Compare
|
|
||
| // Outside month days (visible when showOutsideDays is true): use a lighter text color. | ||
| .components-calendar__day--outside { | ||
| color: $components-color-gray-600; |
There was a problem hiding this comment.
We may potentially want to use the same shade of gray that we use for disabled days (ie. $components-color-gray-400), althouth this is something to confirm with @WordPress/gutenberg-design folks
There was a problem hiding this comment.
I went with $components-color-gray-600 since it looked closer to the shade used in the proposal #76150. I also thought it might be better to keep it different from the disabled days, since outside days are still clickable and could themselves be disabled. In that case, using a different base shade might help distinguish the two states.
Happy to adjust if we get a confirmation from the @WordPress/gutenberg-design folks.
There was a problem hiding this comment.
|
@ciampo, thanks for the review! I added the changelog entry.
The |
a7b9a85 to
2c763d6
Compare
Right—I guess the main thing missing is a Storybook example for the |
There was a problem hiding this comment.
Looks like everything is working as expected, even though things get a bit awkward when showOutsideDays and fixedWeeks are enabled, and numberOfMonths is 2 or more.
One date selected in DateCalendar:
A date range selected in DateRangeCalendar:
I guess we can merge and tweak as needed. Thank you again, @yuliyan !



What?
Fixes #76150
Expose
showOutsideDaysandfixedWeeksonDateCalendarandDateRangeCalendar, add styling for outside-month days (lighter text), and add a Storybook story for the outside days case.Why?
Consumers need to optionally show days from adjacent months in the grid and keep a fixed number of weeks so layout doesn't jump between months. These map to react-day-picker's
showOutsideDaysandfixedWeeks. They were only inCOMMON_PROPSand not in the public TypeScript props. Outside days also need a clear but de-emphasized style when shown.How?
showOutsideDaysandfixedWeeksto theBaseProps.'components-calendar__day--outsidefor theoutsidemodifier in constants.ts..components-calendar__day--outside.fixedWeeksandshowOutsideDaysprops.Testing Instructions
npm run storybook:devfrom repo root.showOutsideDaysandfixedWeeksand confirm behavior.Testing Instructions for Keyboard
Screenshots or screencast