UNPKG

8.84 kBCSSView Raw
1/* Variables declaration */
2/* prettier-ignore */
3.rdp-root {
4 --rdp-accent-color: blue; /* The accent color used for selected days and UI elements. */
5 --rdp-accent-background-color: #f0f0ff; /* The accent background color used for selected days and UI elements. */
6 --rdp-font-family: system-ui; /* The font family used by the calendar. Note that `inherit`does not work here. */
7
8 --rdp-day-font: inherit; /* The font used for the day cells. */
9 --rdp-day-height: 2.75rem; /* The height of the day cells. */
10 --rdp-day-width: 2.75rem; /* The width of the day cells. */
11
12 --rdp-day_button-border-radius: 100%; /* The border radius of the day cells. */
13 --rdp-day_button-border: 2px solid transparent; /* The border of the day cells. */
14 --rdp-day_button-height: var(--rdp-day-width); /* The height of the day cells. */
15 --rdp-day_button-width: var(--rdp-day-height); /* The width of the day cells. */
16
17 --rdp-selected-border: 2px solid var(--rdp-accent-color); /* The border of the selected days. */
18 --rdp-selected-font: bold large var(--rdp-font-family); /* The font of the selected days. */
19 --rdp-disabled-opacity: 0.5; /* The opacity of the disabled days. */
20 --rdp-outside-opacity: 0.75; /* The opacity of the days outside the current month. */
21 --rdp-today-color: var(--rdp-accent-color); /* The color of the today's date. */
22
23 --rdp-dropdown-gap: 0.5rem;/* The gap between the dropdowns used in the month captons. */
24
25 --rdp-month_caption-font: bold larger var(--rdp-font-family); /* The font of the month caption. */
26 --rdp-months-gap: 2rem; /* The gap between the months in the multi-month view. */
27
28 --rdp-nav_button-disabled-opacity: 0.5; /* The opacity of the disabled navigation buttons. */
29 --rdp-nav_button-height: 2.25rem; /* The height of the navigation buttons. */
30 --rdp-nav_button-width: 2.25rem; /* The width of the navigation buttons. */
31 --rdp-nav-height: 2.75rem; /* The height of the navigation bar. */
32
33 --rdp-range_middle-background-color: var(--rdp-accent-background-color); /* The color of the background for days in the middle of a range. */
34 --rdp-range_middle-font: normal medium var(--rdp-font-family); /* The font for days in the middle of a range. */
35 --rdp-range_middle-foreground-color: white; /* The font for days in the middle of a range. */
36 --rdp-range_middle-color: inherit;/* The color of the range text. */
37
38 --rdp-range_start-color: white; /* The color of the range text. */
39 --rdp-range_start-background: linear-gradient(var(--rdp-gradient-direction), transparent 50%, var(--rdp-range_middle-background-color) 50%); /* Used for the background of the start of the selected range. */
40 --rdp-range_start-date-background-color: var(--rdp-accent-color); /* The background color of the date when at the start of the selected range. */
41
42 --rdp-range_end-background: linear-gradient(var(--rdp-gradient-direction), var(--rdp-range_middle-background-color) 50%, transparent 50%); /* Used for the background of the end of the selected range. */
43 --rdp-range_end-color: white;/* The color of the range text. */
44 --rdp-range_end-date-background-color: var(--rdp-accent-color); /* The background color of the date when at the end of the selected range. */
45
46 --rdp-week_number-border-radius: 100%; /* The border radius of the week number. */
47 --rdp-week_number-border: 2px solid transparent; /* The border of the week number. */
48 --rdp-week_number-font: 400 small var(--rdp-font-family); /* The font of the week number cells. */
49 --rdp-week_number-height: var(--rdp-day-height); /* The height of the week number cells. */
50 --rdp-week_number-opacity: 0.75; /* The opacity of the week number. */
51 --rdp-week_number-width: var(--rdp-day-width); /* The width of the week number cells. */
52 --rdp-weeknumber-text-align: center; /* The text alignment of the weekday cells. */
53
54 --rdp-weekday-font: 500 smaller var(--rdp-font-family); /* The font of the weekday. */
55 --rdp-weekday-opacity: 0.75; /* The opacity of the weekday. */
56 --rdp-weekday-padding: 0.5rem 0rem; /* The padding of the weekday. */
57 --rdp-weekday-text-align: center; /* The text alignment of the weekday cells. */
58
59 --rdp-gradient-direction: 90deg;
60}
61
62.rdp-root[dir="rtl"] {
63 --rdp-gradient-direction: -90deg;
64}
65
66/* Root of the component. */
67.rdp-root {
68 position: relative; /* Required to position the navigation toolbar. */
69 box-sizing: border-box;
70}
71
72.rdp-root * {
73 box-sizing: border-box;
74}
75
76/* Reset buttons */
77.rdp-root button {
78 border: none;
79 background: none;
80 padding: 0;
81 margin: 0;
82 cursor: pointer;
83 font: inherit;
84 color: inherit;
85}
86
87.rdp-day {
88 width: var(--rdp-day-width);
89 height: var(--rdp-day-height);
90 font: var(--rdp-day-font);
91 text-align: center;
92}
93
94.rdp-day_button {
95 justify-content: center;
96 align-items: center;
97 display: flex;
98
99 width: var(--rdp-day_button-width);
100 height: var(--rdp-day_button-height);
101 border: var(--rdp-day_button-border);
102 border-radius: var(--rdp-day_button-border-radius);
103}
104
105.rdp-day_button:disabled {
106 cursor: revert;
107}
108
109.rdp-caption_label {
110 z-index: 1;
111
112 position: relative;
113 display: inline-flex;
114 align-items: center;
115
116 white-space: nowrap;
117 border: 0;
118}
119
120.rdp-button_next,
121.rdp-button_previous {
122 -moz-appearance: none;
123 -webkit-appearance: none;
124 display: inline-flex;
125 align-items: center;
126 justify-content: center;
127 margin: 0;
128 padding: 0;
129 position: relative;
130 font: inherit;
131 appearance: none;
132 background: none;
133 border: 0;
134 color: inherit;
135 cursor: pointer;
136
137 width: var(--rdp-nav_button-width);
138 height: var(--rdp-nav_button-height);
139}
140
141.rdp-button_next:disabled,
142.rdp-button_previous:disabled {
143 cursor: revert;
144
145 opacity: var(--rdp-nav_button-disabled-opacity);
146}
147
148.rdp-chevron {
149 display: inline-block;
150 fill: var(--rdp-accent-color);
151}
152
153.rdp-root[dir="rtl"] .rdp-nav .rdp-chevron {
154 transform: rotate(180deg);
155}
156
157.rdp-root[dir="rtl"] .rdp-nav .rdp-chevron {
158 transform: rotate(180deg);
159 transform-origin: 50%;
160}
161
162.rdp-dropdowns {
163 position: relative;
164 display: inline-flex;
165 align-items: center;
166 gap: var(--rdp-dropdown-gap);
167}
168.rdp-dropdown {
169 z-index: 2;
170
171 /* Reset */
172 opacity: 0;
173 appearance: none;
174 position: absolute;
175 inset-block-start: 0;
176 inset-block-end: 0;
177 inset-inline-start: 0;
178 width: 100%;
179 margin: 0;
180 padding: 0;
181 cursor: inherit;
182 border: none;
183 line-height: inherit;
184}
185
186.rdp-dropdown_root {
187 position: relative;
188 display: inline-flex;
189 align-items: center;
190}
191
192.rdp-dropdown_root[data-disabled="true"] .rdp-chevron {
193 opacity: var(--rdp-disabled-opacity);
194}
195
196.rdp-month_caption {
197 display: flex;
198 align-content: center;
199 height: var(--rdp-nav-height);
200 font: var(--rdp-month_caption-font);
201}
202
203.rdp-months {
204 position: relative;
205 display: flex;
206 flex-wrap: wrap;
207 gap: var(--rdp-months-gap);
208 max-width: fit-content;
209}
210
211.rdp-month_grid {
212 border-collapse: collapse;
213}
214
215.rdp-nav {
216 position: absolute;
217 inset-block-start: 0;
218 inset-inline-end: 0;
219
220 display: flex;
221 align-items: center;
222
223 height: var(--rdp-nav-height);
224}
225
226.rdp-weekday {
227 opacity: var(--rdp-weekday-opacity);
228 padding: var(--rdp-weekday-padding);
229 font: var(--rdp-weekday-font);
230 text-align: var(--rdp-weekday-text-align);
231 text-transform: var(--rdp-weekday-text-transform);
232}
233
234.rdp-week_number {
235 opacity: var(--rdp-week_number-opacity);
236 font: var(--rdp-week_number-font);
237 height: var(--rdp-week_number-height);
238 width: var(--rdp-week_number-width);
239 border: var(--rdp-week_number-border);
240 border-radius: var(--rdp-week_number-border-radius);
241 text-align: var(--rdp-weeknumber-text-align);
242}
243
244/* DAY MODIFIERS */
245.rdp-today:not(.rdp-outside) {
246 color: var(--rdp-today-color);
247}
248
249.rdp-selected {
250 font: var(--rdp-selected-font);
251}
252
253.rdp-selected .rdp-day_button {
254 border: var(--rdp-selected-border);
255}
256
257.rdp-outside {
258 opacity: var(--rdp-outside-opacity);
259}
260
261.rdp-disabled {
262 opacity: var(--rdp-disabled-opacity);
263}
264
265.rdp-hidden {
266 visibility: hidden;
267 color: var(--rdp-range_start-color);
268}
269
270.rdp-range_start {
271 background: var(--rdp-range_start-background);
272}
273
274.rdp-range_start .rdp-day_button {
275 background-color: var(--rdp-range_start-date-background-color);
276 color: var(--rdp-range_start-color);
277}
278
279.rdp-range_middle {
280 background-color: var(--rdp-range_middle-background-color);
281 font: var(--rdp-range_middle-font);
282}
283
284.rdp-range_middle .rdp-day_button {
285 border-color: transparent;
286 border: unset;
287 border-radius: unset;
288 color: var(--rdp-range_middle-color);
289}
290
291.rdp-range_end {
292 background: var(--rdp-range_end-background);
293 color: var(--rdp-range_end-color);
294}
295
296.rdp-range_end .rdp-day_button {
297 color: var(--rdp-range_start-color);
298 background-color: var(--rdp-range_end-date-background-color);
299}
300
301.rdp-range_start.rdp-range_end {
302 background: revert;
303}
304
305.rdp-focusable {
306 cursor: pointer;
307}