Skip to content

Commit 9c5b7d5

Browse files
authored
fix: use correct styles for week number cells (#3734)
1 parent 7a16f0f commit 9c5b7d5

8 files changed

Lines changed: 13 additions & 14 deletions

File tree

‎packages/date-picker/src/vaadin-month-calendar.js‎

Lines changed: 8 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -23,18 +23,8 @@ class MonthCalendar extends FocusMixin(ThemableMixin(PolymerElement)) {
2323
}
2424
2525
#monthGrid {
26-
display: block;
27-
}
28-
29-
#monthGrid thead,
30-
#monthGrid tbody {
31-
display: block;
3226
width: 100%;
33-
}
34-
35-
[part='weekdays'] {
36-
display: flex;
37-
flex-grow: 1;
27+
border-collapse: collapse;
3828
}
3929
4030
#days-container tr,
@@ -53,9 +43,7 @@ class MonthCalendar extends FocusMixin(ThemableMixin(PolymerElement)) {
5343
5444
[part='weekday'],
5545
[part='date'] {
56-
display: block;
57-
/* Would use calc(100% / 7) but it doesn't work nice on IE */
58-
width: 14.285714286%;
46+
width: calc(100% / 7);
5947
padding: 0;
6048
font-weight: normal;
6149
}
@@ -64,6 +52,12 @@ class MonthCalendar extends FocusMixin(ThemableMixin(PolymerElement)) {
6452
[part='week-number'] {
6553
width: 12.5%;
6654
flex-shrink: 0;
55+
padding: 0;
56+
}
57+
58+
:host([week-numbers]) [part='weekday']:not(:empty),
59+
:host([week-numbers]) [part='date'] {
60+
width: 12.5%;
6761
}
6862
</style>
6963
320 Bytes
Loading
393 Bytes
Loading
202 Bytes
Loading
-735 Bytes
Loading
401 Bytes
Loading
-461 Bytes
Loading

‎packages/date-picker/theme/lumo/vaadin-month-calendar-styles.js‎

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -68,6 +68,11 @@ registerStyles(
6868
cursor: var(--lumo-clickable-cursor);
6969
}
7070
71+
:host([week-numbers]) [part='weekday']:not(:empty),
72+
:host([week-numbers]) [part='date'] {
73+
width: calc((100% - var(--lumo-size-xs)) / 7);
74+
}
75+
7176
/* Today date */
7277
7378
[part='date'][today] {

0 commit comments

Comments
 (0)