|
5 | 5 | */ |
6 | 6 | @media lumo_components_date-picker-month-calendar { |
7 | 7 | :host { |
8 | | - display: block; |
9 | | - -webkit-user-select: none; |
10 | | - -webkit-tap-highlight-color: transparent; |
11 | | - user-select: none; |
12 | 8 | font-size: var(--lumo-font-size-m); |
13 | 9 | color: var(--lumo-body-text-color); |
14 | 10 | text-align: center; |
15 | | - padding: 0 var(--lumo-space-xs); |
| 11 | + padding: var(--vaadin-date-picker-month-padding, 0 var(--lumo-space-xs)); |
16 | 12 | --_focus-ring-color: var(--vaadin-focus-ring-color, var(--lumo-primary-color-50pct)); |
17 | 13 | --_focus-ring-width: var(--vaadin-focus-ring-width, 2px); |
18 | 14 | --_selection-color: var(--vaadin-selection-color, var(--lumo-primary-color)); |
19 | 15 | --_selection-color-text: var(--vaadin-selection-color-text, var(--lumo-primary-text-color)); |
20 | 16 | } |
21 | 17 |
|
22 | | - #monthGrid { |
23 | | - width: 100%; |
24 | | - border-collapse: collapse; |
25 | | - } |
26 | | - |
27 | | - #days-container tr, |
28 | | - #weekdays-container tr { |
29 | | - display: flex; |
30 | | - } |
31 | | - |
32 | 18 | [part~='disabled'] { |
33 | 19 | pointer-events: none; |
34 | 20 | } |
35 | 21 |
|
36 | 22 | /* Month header */ |
37 | 23 |
|
38 | 24 | [part='month-header'] { |
39 | | - color: var(--lumo-header-text-color); |
40 | | - font-size: var(--lumo-font-size-l); |
41 | | - line-height: 1; |
42 | | - font-weight: 500; |
| 25 | + color: var(--vaadin-date-picker-month-header-color, var(--lumo-header-text-color)); |
| 26 | + font-size: var(--vaadin-date-picker-month-header-font-size, var(--lumo-font-size-l)); |
43 | 27 | margin-bottom: var(--lumo-space-m); |
44 | 28 | } |
45 | 29 |
|
46 | 30 | /* Week days and numbers */ |
47 | 31 |
|
48 | | - [part='weekdays'], |
49 | | - [part='weekday'], |
50 | | - [part='week-number'] { |
51 | | - font-size: var(--lumo-font-size-xxs); |
| 32 | + [part~='weekday'] { |
| 33 | + color: var(--vaadin-date-picker-weekday-color, var(--lumo-secondary-text-color)); |
| 34 | + font-size: var(--vaadin-date-picker-weekday-font-size, var(--lumo-font-size-xxs)); |
| 35 | + font-weight: var(--vaadin-date-picker-weekday-font-weight, normal); |
52 | 36 | line-height: 1; |
53 | | - color: var(--lumo-secondary-text-color); |
54 | | - } |
55 | | - |
56 | | - [part='weekdays'] { |
57 | 37 | margin-bottom: var(--lumo-space-s); |
58 | 38 | } |
59 | 39 |
|
60 | | - [part='weekday']:empty, |
61 | | - [part='week-number'] { |
62 | | - flex-shrink: 0; |
63 | | - padding: 0; |
64 | | - width: var(--lumo-size-xs); |
| 40 | + :host([week-numbers]) table { |
| 41 | + grid-template-columns: var(--lumo-size-xs) repeat(7, 1fr); |
65 | 42 | } |
66 | 43 |
|
67 | | - [part='week-number'][hidden], |
68 | | - [part='weekday'][hidden] { |
69 | | - display: none; |
| 44 | + :host([week-numbers]) [part~='weekday']:empty { |
| 45 | + display: flex; |
70 | 46 | } |
71 | 47 |
|
72 | | - /* Date and week number cells */ |
| 48 | + [part~='week-number'] { |
| 49 | + color: var(--vaadin-date-picker-week-number-color, var(--lumo-secondary-text-color)); |
| 50 | + font-size: var(--vaadin-date-picker-week-number-font-size, var(--lumo-font-size-xxs)); |
| 51 | + grid-column: auto; |
| 52 | + margin: 0; |
| 53 | + } |
73 | 54 |
|
74 | | - [part~='date'], |
75 | | - [part='week-number'] { |
76 | | - box-sizing: border-box; |
77 | | - display: inline-flex; |
78 | | - align-items: center; |
79 | | - justify-content: center; |
80 | | - height: var(--lumo-size-m); |
81 | | - position: relative; |
| 55 | + [part~='week-number']::after { |
| 56 | + display: none; |
82 | 57 | } |
83 | 58 |
|
| 59 | + /* Date cells */ |
| 60 | + |
84 | 61 | [part~='date'] { |
85 | | - outline: none; |
| 62 | + border-radius: var(--vaadin-date-picker-date-border-radius, var(--lumo-border-radius-m)); |
| 63 | + height: var(--vaadin-date-picker-date-height, var(--lumo-size-m)); |
86 | 64 | transition: color 0.1s; |
87 | 65 | } |
88 | 66 |
|
89 | 67 | [part~='date']:not(:empty) { |
90 | 68 | cursor: var(--lumo-clickable-cursor); |
91 | 69 | } |
92 | 70 |
|
93 | | - [part='weekday'], |
94 | | - [part~='date'] { |
95 | | - width: calc(100% / 7); |
96 | | - padding: 0; |
97 | | - font-weight: normal; |
98 | | - } |
99 | | - |
100 | | - :host([week-numbers]) [part='weekday']:not(:empty), |
101 | | - :host([week-numbers]) [part~='date'] { |
102 | | - width: calc((100% - var(--lumo-size-xs)) / 7); |
| 71 | + [part~='today'] { |
| 72 | + color: var(--vaadin-date-picker-date-today-color, var(--_selection-color-text)); |
103 | 73 | } |
104 | 74 |
|
105 | | - /* Today date */ |
106 | | - |
107 | | - [part~='date'][part~='today'] { |
108 | | - color: var(--_selection-color-text); |
| 75 | + [part~='selected'] { |
| 76 | + color: var(--vaadin-date-picker-date-selected-color, var(--lumo-primary-contrast-color)); |
109 | 77 | } |
110 | 78 |
|
111 | | - /* Focused date */ |
| 79 | + /* Selection, hover and focus indicator */ |
112 | 80 |
|
113 | | - [part~='date']::before { |
114 | | - content: ''; |
115 | | - position: absolute; |
116 | | - z-index: -1; |
| 81 | + [part~='date']::after { |
117 | 82 | top: 50%; |
118 | 83 | left: 50%; |
119 | | - transform: translate(-50%, -50%); |
120 | | - min-width: 2em; |
121 | | - min-height: 2em; |
| 84 | + translate: -50% -50%; |
122 | 85 | width: 80%; |
123 | 86 | height: 80%; |
124 | | - max-height: 100%; |
| 87 | + min-width: 2em; |
| 88 | + min-height: 2em; |
125 | 89 | max-width: 100%; |
126 | | - border-radius: var(--lumo-border-radius-m); |
| 90 | + max-height: 100%; |
| 91 | + aspect-ratio: auto; |
| 92 | + outline: none; |
| 93 | + } |
| 94 | + |
| 95 | + [part~='selected']::after { |
| 96 | + background: var(--vaadin-date-picker-date-selected-background, var(--_selection-color)); |
127 | 97 | } |
128 | 98 |
|
129 | | - [part~='date'][part~='focused']::before { |
| 99 | + [part~='date'][part~='focused']::after { |
130 | 100 | box-shadow: |
131 | 101 | 0 0 0 1px var(--lumo-base-color), |
132 | 102 | 0 0 0 calc(var(--_focus-ring-width) + 1px) var(--_focus-ring-color); |
133 | 103 | } |
134 | 104 |
|
135 | | - :host(:not([focused])) [part~='date'][part~='focused']::before { |
| 105 | + :host(:not([focused])) [part~='date'][part~='focused']::after { |
136 | 106 | animation: vaadin-date-picker-month-calendar-focus-date 1.4s infinite; |
137 | 107 | } |
138 | 108 |
|
|
144 | 114 | } |
145 | 115 | } |
146 | 116 |
|
147 | | - [part~='date']:not(:empty):not([part~='disabled']):not([part~='selected']):hover::before { |
| 117 | + [part~='date']:not(:empty):not([part~='disabled']):not([part~='selected']):hover::after { |
148 | 118 | background-color: var(--lumo-primary-color-10pct); |
149 | 119 | } |
150 | 120 |
|
151 | | - [part~='date'][part~='selected'] { |
152 | | - color: var(--lumo-primary-contrast-color); |
153 | | - } |
154 | | - |
155 | | - [part~='date'][part~='selected']::before { |
156 | | - background-color: var(--_selection-color); |
157 | | - } |
158 | | - |
159 | | - [part~='date'][part~='disabled'] { |
160 | | - color: var(--lumo-disabled-text-color); |
161 | | - } |
162 | | - |
163 | 121 | @media (pointer: coarse) { |
164 | | - [part~='date']:hover:not([part~='selected'])::before, |
165 | | - :host(:not([focus-ring])) [part~='focused']:not([part~='selected'])::before { |
| 122 | + [part~='date']:hover:not([part~='selected'])::after, |
| 123 | + :host(:not([focus-ring])) [part~='focused']:not([part~='selected'])::after { |
166 | 124 | display: none; |
167 | 125 | } |
168 | 126 |
|
169 | | - [part~='date']:not(:empty):not([part~='disabled']):active::before { |
| 127 | + [part~='date']:not(:empty):not([part~='disabled']):active::after { |
170 | 128 | display: block; |
171 | 129 | } |
172 | 130 |
|
173 | | - :host(:not([focus-ring])) [part~='date'][part~='selected']::before { |
| 131 | + :host(:not([focus-ring])) [part~='date'][part~='selected']::after { |
174 | 132 | box-shadow: none; |
175 | 133 | } |
176 | 134 | } |
| 135 | + |
177 | 136 | /* Disabled */ |
178 | 137 |
|
| 138 | + [disabled] { |
| 139 | + color: var(--vaadin-date-picker-date-disabled-color, var(--lumo-disabled-text-color)); |
| 140 | + opacity: 1; |
| 141 | + } |
| 142 | + |
179 | 143 | :host([disabled]) * { |
180 | 144 | color: var(--lumo-disabled-text-color) !important; |
181 | 145 | } |
|
0 commit comments