Repository navigation
refactor!: update month-calendar Lumo to use base styles - #12595
Conversation
6558e2d to
2dc4f79
Compare
vaadin-review-bot
left a comment
There was a problem hiding this comment.
Reviewed the changes — left 2 comments.
| Finding | |
|---|---|
| 📐 | Lumo assigns the --vaadin-date-picker-* properties on :host, so applications can no longer override them |
| 📐 | PR is marked breaking (refactor!) but the description does not say what breaks |
91a268b to
5a24690
Compare
The month calendar rendered from the Lumo stylesheet alone, because LumoInjectionMixin drops the component base styles unless a component opts in. Lumo now layers on top of them and keeps only what base cannot express, so a rule added to base styles reaches Lumo as well. Two rules exist purely to keep Lumo pixel-identical. The grid tracks are pinned to the percentage widths Lumo used with flex rows, because base's `repeat(7, 1fr)` distributes the leftover fraction differently and moved text antialiasing by a sub-pixel. Disabled dates pin `opacity: 1`, since base dims them and Lumo only changes their color. Week numbers keep the Lumo layout, a narrow column beside each week, by overriding the grid template, the cell placement and base's divider. Added a disabled-dates visual test, the one Lumo rule that no screenshot covered. Its baselines were generated before this change, so all 33 Lumo screenshots match the previous rendering byte for byte. Co-Authored-By: Claude Fable 5.1 <noreply@anthropic.com>
Declaring the --vaadin-date-picker-* properties on :host inside the shadow root won over any value an application set on the date picker or the document, so the documented properties were inert under Lumo. Each rule now reads its property with the Lumo value as the fallback, the pattern guidelines/theming.md describes. The disabled color rule moves after today and selected, which share its specificity, so a disabled date that is also today keeps the disabled color as before. Co-Authored-By: Claude Fable 5.1 <noreply@anthropic.com>
5a24690 to
94a5aa2
Compare
DiegoCardoso
left a comment
There was a problem hiding this comment.
This finding is worth checking:
vaadin-month-calendar now reads --vaadin-date-picker-date-height and
--vaadin-date-picker-month-header-font-size, but
packages/vaadin-lumo-styles/src/components/date-picker-overlay-content.css:28-34
still pins --vaadin-infinite-scroller-item-height to a hardcoded Lumo calc() that
reads none of them. The two now disagree.
Measured on this branch with Lumo:
--vaadin-date-picker-date-height |
Month calendar | Scroller item |
|---|---|---|
| unset | 270px | 279px |
3rem |
342px | 279px |
At 3rem the months overlap — February's header lands on top of January's last week.
--vaadin-date-picker-month-header-font-size: 2rem overflows too (284px vs 279px), and
-month-padding / -weekday-font-size eat the 9px of slack until they overflow as well.
On main all of these measure 270px, because the properties were inert under Lumo. So
the PR turns "documented property silently ignored" into "documented property produces a
broken layout", which is the worse of the two. The base theme handles it correctly —
vaadin-date-picker-overlay-content-base-styles.js:62-70 derives the item height from
the same properties — so the fix belongs in the Lumo override:
/* prettier-ignore */
--vaadin-infinite-scroller-item-height:
calc(
var(--vaadin-date-picker-month-header-font-size, var(--lumo-font-size-l)) + var(--lumo-space-m)
+ var(--vaadin-date-picker-weekday-font-size, var(--lumo-font-size-xs)) + var(--lumo-space-s)
+ var(--vaadin-date-picker-date-height, var(--lumo-size-m)) * 6
+ var(--lumo-space-s)
);
Thanks, I had this finding reported as well. IMO it's not a blocker but I'll think how to address it. |
The month calendar reads --vaadin-date-picker-date-height, -month-header-font-size and -weekday-font-size, while the scroller item height was a fixed calc of Lumo tokens. Overriding any of the three grew the calendar but not its slot, so months overlapped. The calc now reads the same properties with the Lumo tokens as fallbacks, so both move together and the default stays at the same pixel height. Co-Authored-By: Claude Fable 5.1 <noreply@anthropic.com>
…rule Both rules have the same specificity, so the later one wins for any shared property. The selected rule now follows the generic one, next to the other state rules, so a property added to the generic rule cannot override the selected state by accident. Co-Authored-By: Claude Fable 5.1 <noreply@anthropic.com>
Updated. |
DiegoCardoso
left a comment
There was a problem hiding this comment.
LGTM
I couldn't find any blocker issues
Base sizes the seven day columns with 1fr, which distributes the remainder pixels across the tracks. Lumo restated them as seven fixed percentage tracks, which can leave a sub-pixel gap when the width is not divisible by seven. The week number layout still needs its own track list, because Lumo places the week number in a narrow leading column while base spans it across the row, but its day columns use 1fr as well. Co-Authored-By: Claude Opus 5 (1M context) <noreply@anthropic.com>
|



Description
Updated
vaadin-month-calendarLumo to use base styles and added overrides to keep the original appearance.Warning
Breaking change: date focus indicators are now using
[part~='date']::afterinstead of::before- affects custom themes, even though docs don't currently list this as public styling API.Type of change