Skip to content

Commit

Permalink
fix: use correct styles for week number cells (#3734) (#3736)
Browse files Browse the repository at this point in the history
Co-authored-by: Serhii Kulykov <iamkulykov@gmail.com>
  • Loading branch information
vaadin-bot and web-padawan committed Apr 26, 2022
1 parent 9a70ceb commit 485eef6
Show file tree
Hide file tree
Showing 8 changed files with 13 additions and 14 deletions.
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

0 comments on commit 485eef6

Please sign in to comment.