Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

fix: use correct styles for week number cells (#3734) (CP: 23.0) #3736

Merged
merged 1 commit into from
Apr 26, 2022
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
22 changes: 8 additions & 14 deletions packages/date-picker/src/vaadin-month-calendar.js
Original file line number Diff line number Diff line change
Expand Up @@ -23,18 +23,8 @@ class MonthCalendar extends FocusMixin(ThemableMixin(PolymerElement)) {
}

#monthGrid {
display: block;
}

#monthGrid thead,
#monthGrid tbody {
display: block;
width: 100%;
}

[part='weekdays'] {
display: flex;
flex-grow: 1;
border-collapse: collapse;
}

#days-container tr,
Expand All @@ -53,9 +43,7 @@ class MonthCalendar extends FocusMixin(ThemableMixin(PolymerElement)) {

[part='weekday'],
[part='date'] {
display: block;
/* Would use calc(100% / 7) but it doesn't work nice on IE */
width: 14.285714286%;
width: calc(100% / 7);
padding: 0;
font-weight: normal;
}
Expand All @@ -64,6 +52,12 @@ class MonthCalendar extends FocusMixin(ThemableMixin(PolymerElement)) {
[part='week-number'] {
width: 12.5%;
flex-shrink: 0;
padding: 0;
}

:host([week-numbers]) [part='weekday']:not(:empty),
:host([week-numbers]) [part='date'] {
width: 12.5%;
}
</style>

Expand Down
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Original file line number Diff line number Diff line change
Expand Up @@ -68,6 +68,11 @@ registerStyles(
cursor: var(--lumo-clickable-cursor);
}

:host([week-numbers]) [part='weekday']:not(:empty),
:host([week-numbers]) [part='date'] {
width: calc((100% - var(--lumo-size-xs)) / 7);
}

/* Today date */

[part='date'][today] {
Expand Down