Skip to content

refactor!: update month-calendar Lumo to use base styles - #12595

Merged
web-padawan merged 5 commits into
mainfrom
refactor/month-calendar-lumo-base-styles
Sep 11, 2026
Merged

web-padawan merged 5 commits into
mainfrom
refactor/month-calendar-lumo-base-styles

Conversation

@web-padawan

@web-padawan web-padawan commented Sep 2, 2026 •

Copy link
Copy Markdown
Member

Description

Updated vaadin-month-calendar Lumo to use base styles and added overrides to keep the original appearance.

Warning

Breaking change: date focus indicators are now using [part~='date']::after instead of ::before - affects custom themes, even though docs don't currently list this as public styling API.

Type of change

  • Refactor

@web-padawan
web-padawan force-pushed the refactor/month-calendar-lumo-base-styles branch from 6558e2d to 2dc4f79 Compare September 4, 2026 06:37
@web-padawan
web-padawan marked this pull request as ready for review September 7, 2026 09:19

@vaadin-review-bot vaadin-review-bot left a comment

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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

@web-padawan
web-padawan force-pushed the refactor/month-calendar-lumo-base-styles branch from 91a268b to 5a24690 Compare September 10, 2026 13:35
web-padawan and others added 2 commits September 10, 2026 16:39
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>
@web-padawan
web-padawan force-pushed the refactor/month-calendar-lumo-base-styles branch from 5a24690 to 94a5aa2 Compare September 10, 2026 13:39
@web-padawan
web-padawan requested a review from vursen September 10, 2026 13:44

@DiegoCardoso DiegoCardoso left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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)
  );

@web-padawan

Copy link
Copy Markdown
Member Author

date-picker-overlay-content.css:28-34 still pins --vaadin-infinite-scroller-item-height to a hardcoded Lumo calc()

Thanks, I had this finding reported as well. IMO it's not a blocker but I'll think how to address it.

web-padawan and others added 2 commits September 11, 2026 09:34
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>
@web-padawan

Copy link
Copy Markdown
Member Author

the fix belongs in the Lumo override:

Updated.

@DiegoCardoso DiegoCardoso left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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>
@sonarqubecloud

Copy link
Copy Markdown

@web-padawan
web-padawan requested a review from jouni September 11, 2026 08:44
@web-padawan
web-padawan merged commit cc2a52a into main Sep 11, 2026
15 checks passed
@web-padawan
web-padawan deleted the refactor/month-calendar-lumo-base-styles branch September 11, 2026 13:22
web-padawan added a commit that referenced this pull request Sep 11, 2026
…2746)

Co-authored-by: Serhii Kulykov <iamkulykov@gmail.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

5 participants