UNPKG

9.77 kBSCSSView Raw
1//
2// Copyright IBM Corp. 2016, 2018
3//
4// This source code is licensed under the Apache-2.0 license found in the
5// LICENSE file in the root directory of this source tree.
6//
7
8/* stylelint-disable */
9
10@import '../../globals/scss/typography';
11@import '../../globals/scss/helper-mixins';
12
13.flatpickr-calendar {
14 background: transparent;
15 overflow: hidden;
16 max-height: 0;
17 opacity: 0;
18 visibility: hidden;
19 text-align: center;
20 padding: 0;
21 animation: none;
22 direction: ltr;
23 border: 0;
24 font-size: 14px;
25 line-height: 24px;
26 border-radius: 5px;
27 position: absolute;
28 width: 315px;
29 box-sizing: border-box;
30 touch-action: manipulation;
31 background: #fff;
32 box-shadow: 1px 0 0 #e6e6e6, -1px 0 0 #e6e6e6, 0 1px 0 #e6e6e6,
33 0 -1px 0 #e6e6e6, 0 3px 13px rgba(0, 0, 0, 0.08);
34}
35
36.flatpickr-calendar.open,
37.flatpickr-calendar.inline {
38 opacity: 1;
39 visibility: inherit;
40 overflow: visible;
41 max-height: 640px;
42}
43
44.flatpickr-calendar.open {
45 @include box-shadow;
46 z-index: 99999;
47 display: flex;
48 flex-direction: column;
49 align-items: center;
50 justify-content: center;
51 width: rem(288px);
52 height: rem(336px);
53 padding: $carbon--spacing-02 $carbon--spacing-02 $carbon--spacing-03
54 $carbon--spacing-02;
55 border: none;
56 margin-top: -2px;
57 overflow: hidden;
58 background-color: $ui-01;
59
60 &:focus {
61 @include focus-outline('border');
62 }
63}
64
65.flatpickr-calendar.animate.open {
66 animation: fpFadeInDown $duration--fast-02 motion(entrance, productive);
67}
68
69.flatpickr-calendar.inline {
70 display: block;
71 position: relative;
72 top: 2px;
73}
74
75.flatpickr-calendar.static {
76 position: absolute;
77 top: calc(100% + 2px);
78}
79
80.flatpickr-calendar.static.open {
81 z-index: 999;
82 display: block;
83}
84
85.flatpickr-calendar.hasWeeks {
86 width: auto;
87}
88
89.flatpickr-calendar .hasWeeks .dayContainer,
90.flatpickr-calendar .hasTime .dayContainer {
91 border-bottom: 0;
92 border-bottom-right-radius: 0;
93 border-bottom-left-radius: 0;
94}
95.flatpickr-calendar .hasWeeks .dayContainer {
96 border-left: 0;
97}
98.flatpickr-calendar.showTimeInput.hasTime .flatpickr-time {
99 height: 40px;
100 border-top: 1px solid #e6e6e6;
101}
102.flatpickr-calendar.noCalendar.hasTime .flatpickr-time {
103 height: auto;
104}
105
106.flatpickr-calendar:focus {
107 outline: 0;
108}
109
110.flatpickr-months {
111 display: flex;
112 justify-content: space-between;
113 width: 100%;
114}
115.flatpickr-month {
116 @include type-style('productive-heading-01');
117 height: rem(40px);
118 display: flex;
119 align-items: center;
120 margin-bottom: $carbon--spacing-02;
121 background-color: transparent;
122 color: $text-01;
123 line-height: 1;
124 text-align: center;
125}
126
127.flatpickr-prev-month,
128.flatpickr-next-month {
129 text-decoration: none;
130 cursor: pointer;
131 line-height: 16px;
132 height: 28px;
133 padding: 10px calc(3.57% - 1.5px);
134 z-index: 3;
135}
136
137.flatpickr-prev-month,
138.flatpickr-next-month {
139 display: flex;
140 align-items: center;
141 justify-content: center;
142 height: rem(40px);
143 width: rem(40px);
144 padding: 0;
145 fill: $text-01;
146 transition: background-color $duration--fast-01 motion(standard, productive);
147
148 &:hover {
149 background-color: $hover-ui;
150 }
151}
152
153.flatpickr-prev-month:hover svg,
154.flatpickr-next-month:hover svg {
155 fill: $text-01;
156}
157
158.flatpickr-next-month.disabled,
159.flatpickr-prev-month.disabled {
160 svg {
161 fill: $ui-05;
162 cursor: not-allowed;
163 }
164
165 &:hover svg {
166 fill: $ui-05;
167 }
168}
169
170.flatpickr-current-month {
171 @include type-style('productive-heading-01');
172 display: flex;
173 align-items: center;
174 justify-content: center;
175 height: rem(28px);
176 text-align: center;
177}
178
179.flatpickr-current-month .cur-month {
180 margin-left: $carbon--spacing-02;
181 margin-right: $carbon--spacing-02;
182
183 &:hover {
184 background-color: $hover-ui;
185 }
186}
187
188.numInputWrapper {
189 position: relative;
190 width: rem(60px);
191
192 &:hover {
193 background-color: $hover-ui;
194 }
195}
196
197.numInputWrapper:hover .arrowUp,
198.numInputWrapper:hover .arrowDown {
199 opacity: 1;
200}
201
202.numInputWrapper:hover .numInput[disabled] ~ .arrowUp,
203.numInputWrapper:hover .numInput[disabled] ~ .arrowDown {
204 opacity: 0;
205}
206
207.numInputWrapper .numInput {
208 display: inline-block;
209 width: 100%;
210 padding: $carbon--spacing-02;
211 margin: 0;
212 border: none;
213 color: $text-01;
214 font-size: inherit;
215 font-family: inherit;
216 font-weight: 600;
217 background-color: $field-01;
218 cursor: default;
219 // Added in when upgraded to Flatpickr 4.5.5 (#1977)
220 -moz-appearance: textfield; /* Firefox */
221
222 &:focus {
223 @include focus-outline('border');
224 }
225
226 &[disabled],
227 &[disabled]:hover {
228 color: $disabled-02;
229 background-color: $ui-01;
230 pointer-events: none;
231 }
232
233 &::-webkit-outer-spin-button,
234 &::-webkit-inner-spin-button {
235 // Added in when upgraded to Flatpickr 4.5.5 (#1977)
236 -webkit-appearance: none;
237 margin: 0; /* <-- Apparently some margin are still there even though it's hidden */
238 }
239}
240
241.numInput[disabled] ~ .arrowUp::after {
242 border-bottom-color: $disabled-02;
243}
244
245.numInput[disabled] ~ .arrowDown::after {
246 border-top-color: $disabled-02;
247}
248
249.numInputWrapper .arrowUp,
250.numInputWrapper .arrowDown {
251 position: absolute;
252 left: 2.6rem;
253 width: rem(12px);
254 height: 50%;
255 border: none;
256 padding: 0 rem(4px) 0 rem(2px);
257 line-height: 50%;
258 opacity: 0;
259 cursor: pointer;
260
261 &::after {
262 position: absolute;
263 top: 33%;
264 display: block;
265 content: '';
266 border-left: rem(4px) solid transparent;
267 border-right: rem(4px) solid transparent;
268 }
269
270 &:hover::after {
271 border-bottom-color: $interactive-01;
272 border-top-color: $interactive-01;
273 }
274}
275
276.numInputWrapper .arrowUp {
277 top: rem(4px);
278 border-bottom: 0;
279
280 &::after {
281 border-bottom: rem(4px) solid $icon-01;
282 }
283}
284
285.numInputWrapper .arrowDown {
286 top: rem(11px);
287
288 &::after {
289 border-top: rem(4px) solid $icon-01;
290 }
291}
292
293.flatpickr-weekdays {
294 display: flex;
295 align-items: center;
296 height: rem(40px);
297}
298
299.flatpickr-weekdaycontainer {
300 display: flex;
301 width: 100%;
302}
303
304.flatpickr-weekday {
305 @include type-style('body-short-01');
306 cursor: default;
307 color: $text-01;
308 flex: 1;
309}
310
311.flatpickr-days:focus {
312 outline: 0;
313}
314
315.dayContainer {
316 display: flex;
317 flex-wrap: wrap;
318 justify-content: space-around;
319 height: rem(246px);
320 padding: 0;
321 outline: 0;
322}
323
324.flatpickr-calendar.animate .dayContainer.slideLeft {
325 animation: fpFadeOut 400ms cubic-bezier(0.23, 1, 0.32, 1),
326 fpSlideLeft 400ms cubic-bezier(0.23, 1, 0.32, 1);
327}
328
329.flatpickr-calendar.animate .dayContainer.slideLeft,
330.flatpickr-calendar.animate .dayContainer.slideLeftNew {
331 transform: translate3d(-100%, 0px, 0px);
332}
333
334.flatpickr-calendar.animate .dayContainer.slideLeftNew {
335 animation: fpFadeIn 400ms cubic-bezier(0.23, 1, 0.32, 1),
336 fpSlideLeft 400ms cubic-bezier(0.23, 1, 0.32, 1);
337}
338
339.flatpickr-calendar.animate .dayContainer.slideRight {
340 animation: fpFadeOut 400ms cubic-bezier(0.23, 1, 0.32, 1),
341 fpSlideRight 400ms cubic-bezier(0.23, 1, 0.32, 1);
342 transform: translate3d(100%, 0px, 0px);
343}
344
345.flatpickr-calendar.animate .dayContainer.slideRightNew {
346 animation: fpFadeIn 400ms cubic-bezier(0.23, 1, 0.32, 1),
347 fpSlideRightNew 400ms cubic-bezier(0.23, 1, 0.32, 1);
348}
349
350.flatpickr-day {
351 @include type-style('body-short-01');
352 height: rem(40px);
353 width: rem(40px);
354 display: flex;
355 align-items: center;
356 justify-content: center;
357 color: $text-01;
358 cursor: pointer;
359 transition: all $duration--fast-01 motion(standard, productive);
360
361 &:hover {
362 background: $hover-ui;
363 }
364
365 &:focus {
366 @include focus-outline('outline');
367 outline-color: $interactive-01;
368 }
369}
370
371.nextMonthDay,
372.prevMonthDay {
373 color: $text-05;
374}
375
376.flatpickr-day.today {
377 position: relative;
378 color: $link-01;
379 font-weight: 600;
380
381 &::after {
382 content: '';
383 position: absolute;
384 display: block;
385 bottom: rem(7px);
386 left: 50%;
387 transform: translateX(-50%);
388 height: rem(4px);
389 width: rem(4px);
390 background-color: $link-01;
391 }
392}
393
394.flatpickr-day.today.no-border {
395 border: none;
396}
397
398.flatpickr-day.today.selected {
399 @include focus-outline('outline');
400 &::after {
401 display: none;
402 }
403}
404
405.flatpickr-day.inRange {
406 background-color: $highlight;
407 color: $text-01;
408}
409
410.flatpickr-day.selected {
411 color: $text-04;
412 background-color: $interactive-01;
413
414 &:focus {
415 outline: rem(1px) solid $ui-02;
416 outline-offset: rem(-3px);
417 }
418}
419
420.flatpickr-day.startRange.selected {
421 box-shadow: none;
422 z-index: 2;
423}
424
425.flatpickr-day.startRange.inRange:not(.selected),
426.flatpickr-day.endRange.inRange {
427 @include focus-outline('outline');
428 background: $ui-01;
429 z-index: 3;
430}
431
432.flatpickr-day.endRange:hover {
433 @include focus-outline('outline');
434 background: $ui-01;
435 color: $text-01;
436}
437
438.flatpickr-day.endRange.inRange.selected {
439 color: $text-04;
440 background: $interactive-01;
441}
442
443.flatpickr-day.flatpickr-disabled {
444 cursor: not-allowed;
445 color: $disabled-02;
446
447 &:hover {
448 background-color: transparent;
449 }
450}
451
452.flatpickr-input[readonly] {
453 cursor: pointer;
454}
455
456@keyframes fpFadeInDown {
457 from {
458 opacity: 0;
459
460 transform: translate3d(0, -20px, 0);
461 }
462 to {
463 opacity: 1;
464
465 transform: translate3d(0, 0, 0);
466 }
467}
468@keyframes fpSlideLeft {
469 from {
470 transform: translate3d(0px, 0px, 0px);
471 }
472 to {
473 transform: translate3d(-100%, 0px, 0px);
474 }
475}
476@keyframes fpSlideLeftNew {
477 from {
478 transform: translate3d(100%, 0px, 0px);
479 }
480 to {
481 transform: translate3d(0px, 0px, 0px);
482 }
483}
484@keyframes fpSlideRight {
485 from {
486 transform: translate3d(0, 0, 0px);
487 }
488 to {
489 transform: translate3d(100%, 0px, 0px);
490 }
491}
492@keyframes fpSlideRightNew {
493 from {
494 transform: translate3d(-100%, 0, 0px);
495 }
496 to {
497 transform: translate3d(0, 0, 0px);
498 }
499}
500@keyframes fpFadeOut {
501 from {
502 opacity: 1;
503 }
504 to {
505 opacity: 0;
506 }
507}
508@keyframes fpFadeIn {
509 from {
510 opacity: 0;
511 }
512 to {
513 opacity: 1;
514 }
515}