Skip to content

fix: use theme selection color for selected date under Lumo - #123

Merged
scardanzan merged 1 commit into
masterfrom
fix/selected-date-lumo
Nov 3, 2026
Merged

scardanzan merged 1 commit into
masterfrom
fix/selected-date-lumo

Conversation

@paodb

@paodb paodb commented Oct 29, 2026 •

Copy link
Copy Markdown
Member

Fall back to the theme's selection color (--_selection-color) before --vaadin-text-color for the selected date background, so under Lumo it uses --lumo-primary-color, as vaadin-date-picker does, instead of the body text color. Aura is unaffected, since it defines --vaadin-date-picker-date-selected-background.

Close #122

Summary by CodeRabbit

  • Bug Fixes
    • Improved the selected-date background fallback in the month calendar. When no explicit selected-date background is configured, it now uses the selection color rather than the text color.

@coderabbitai

coderabbitai Bot commented Oct 29, 2026 •

Copy link
Copy Markdown

Review in Change Stack →

No actionable comments were generated in the recent review.

Recent review info
Run configuration
  • Source mode: Auto
  • Repository: Unavailable
  • Branch: Unavailable
  • File: No configuration file from this repository applied
  • Commit: Unavailable
  • Layers: Organization UI
  • Review profile: CHILL
  • Plan: Advanced
  • Run ID: 3e7a7cd5-24e8-470c-b464-2a01391fea63
Commits

Reviewing files that changed from the base of the PR and between 3f24cc2 and 1c362a3.

Files selected for processing: 1
  • src/main/resources/META-INF/frontend/fc-month-calendar/vaadin-month-calendar.css

Included review availability: This review used your included allowance. Your plan provides up to 1 included review per hour; 0 remain after this review.

Walkthrough

The selected-date background fallback now checks --_selection-color before --vaadin-text-color when --vaadin-date-picker-date-selected-background is unset.

Changes

Selected-date background

Layer / File(s) Summary
Update selected-date fallback order
src/main/resources/META-INF/frontend/fc-month-calendar/vaadin-month-calendar.css
The selected-date background fallback now checks --_selection-color before --vaadin-text-color.

Priority: Normal

Estimated code review effort: 1 (Trivial) | ~5 minutes

Change: Bug fix · Severity of issue fixed: Medium

Suggested reviewers: javier-godoy

Merge Risk: Minimal · up to 1c362

The selected date now uses the theme selection color as intended, with no identified merge-blocking risk.

Pre-merge checks: Passed 3 · Failed 1

Failed Failed checks: 1 warning

Check name Status Explanation Resolution
Linked Issues check Warning [#122, selection color] Met. The diff changes one declaration in vaadin-month-calendar.css, line 27. The fallback for [part~='date'][part~='selected']::before now checks --_selection-color before --va… In fc-month-calendar.js, update the three injected selectors in connectedCallback() to match tokens in the part attribute, for example [part~='date'][class]::before, [part~='date'][selected], and [part~='date'][selected]::before. Then confi…
Passed Passed checks: 3 passed
Check name Status Explanation
Description Check Passed Check skipped - CodeRabbit’s high-level summary is enabled.
Title check Passed The title clearly and concisely describes the main change: using the theme selection color for selected dates under Lumo.
Out of Scope Changes check Passed The whole-PR diff against the merge base contains one changed line. It is in vaadin-month-calendar.css and changes only the fallback order for the selected-date background. This change implements the …
Full details: Out of Scope Changes check

Explanation

The whole-PR diff against the merge base contains one changed line. It is in vaadin-month-calendar.css and changes only the fallback order for the selected-date background. This change implements the selection-color objective of #122. No unrelated files or changes are present in the diff. The reviewed head contains no other changes from this PR.

Full details: Linked Issues check

Explanation

[#122, selection color] Met. The diff changes one declaration in vaadin-month-calendar.css, line 27. The fallback for [part~='date'][part~='selected']::before now checks --_selection-color before --vaadin-text-color. Under Lumo, the fallback reaches the selection color instead of the text color. This matches the Expected behavior in #122. The result depends on the issue's analysis that Lumo defines --_selection-color as the primary color. This repository does not show that definition, so it is not independently verified here.

[#122, Vaadin 25.2 selectors] Not met. The issue reports that the injected rules in fc-month-calendar.js use an exact [part='date'] match. On Vaadin 25.2, date cells also carry past, future, or today in part. At the reviewed head, connectedCallback() still injects [part='date'][class]::before, [part='date'][selected], and [part='date'][selected]::before with exact matches. The PR does not change fc-month-calendar.js. The PR description states that it closes #122, so this reported defect stays open.

Resolution

In fc-month-calendar.js, update the three injected selectors in connectedCallback() to match tokens in the part attribute, for example [part~='date'][class]::before, [part~='date'][selected], and [part~='date'][selected]::before. Then confirm on Vaadin 25.2 that selected and past, future, or today cells receive these rules. If the 25.2 selector change is not part of this PR, remove the close reference to #122 or split that work into a separate issue.

Finishing Touches
🧪 Generate unit tests (beta)
  • Commit to this branch
  • Create a new PR
  • Autofix · Keep fixing CodeRabbit findings and required CI, and resolving merge conflicts

Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out.

❤️ Share

Comment @coderabbitai help to get the list of available commands.

@sonarqubecloud

Copy link
Copy Markdown

@paodb
paodb marked this pull request as ready for review October 29, 2026 17:04
@paodb
paodb requested a review from scardanzan October 29, 2026 17:04
@scardanzan
scardanzan merged commit 8de8ee6 into master Nov 3, 2026
7 checks passed
@github-project-automation github-project-automation Bot moved this from To Do to Pending release in Flowing Code Addons Nov 3, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

Status: Pending release

Development

Successfully merging this pull request may close these issues.

Selected date is painted with the text color under Lumo, unreadable in dark mode

2 participants