UNPKG

2.19 kBJavaScriptView Raw
1import { css } from 'lit';
2export const datePickerStyling = css `
3:host {
4 --_col: 7;
5 --_row: 6;
6
7 --_body-h: calc(4px + calc(32px * 7)); /** 228px */;
8 --_h: calc(var(--_header-h) + var(--_body-h)); /** 52 + 228 = 280 */
9 --_header-h: 52px;
10 --_w: calc((16px * 2) + (32px * var(--_col))); /** 32 + 224 = 256 */
11
12 display: flex;
13 flex-direction: column;
14
15 min-width: var(--date-picker-min-width, var(--_w));
16 min-height: var(--date-picker-min-height, var(--_h));
17 max-width: var(--date-picker-max-width, var(--_w));
18 max-height: var(--date-picker-max-height, var(--_h));
19 width: 100%;
20 height: 100%;
21 background-color: var(--_surface);
22 color: var(--_on-surface);
23 border-radius: var(--_shape);
24 overscroll-behavior: contain;
25}
26:host([startview="calendar"][showweeknumber]) {
27 --_col: 8;
28}
29
30.header {
31 display: grid;
32 grid-auto-flow: column;
33 justify-content: space-between;
34
35 min-height: var(--_header-h);
36 max-height: var(--_header-h);
37 height: 100%;
38 padding: 4px 0 0 24px;
39 border-radius: var(--_shape);
40 border-bottom-right-radius: 0;
41 border-bottom-left-radius: 0;
42}
43
44/** #region header */
45.month-and-year-selector {
46 display: flex;
47 align-items: center;
48 font-size: 13px;
49}
50
51.selected-year-month {
52 margin: 0;
53 white-space: nowrap;
54}
55
56.year-dropdown,
57[data-navigation="previous"],
58[data-navigation="next"] {
59 min-width: 48px;
60 min-height: 48px;
61 max-width: 48px;
62 max-height: 48px;
63 width: 48px;
64 height: 48px;
65}
66
67.year-dropdown {
68 margin: 0 0 0 -8px;
69 transition: transform 300ms cubic-bezier(0, 0, .4, 1);
70 will-change: transform;
71}
72:host([startview="yearGrid"]) .year-dropdown {
73 transform: rotateZ(180deg);
74}
75
76.month-pagination {
77 display: flex;
78 margin: 0 -4px 0 0;
79}
80/** #endregion header */
81
82.body {
83 border-radius: var(--_shape);
84 border-top-left-radius: 0;
85 border-top-right-radius: 0;
86}
87
88.calendar,
89.year-grid {
90 min-height: var(--_body-h);
91 max-height: var(--_body-h);
92 height: 100%;
93 overflow-x: hidden; /** NOTE(rongsen): Disabling overflow-x to avoid infrequent overflowing. */
94 overflow-y: auto;
95}
96
97.calendar {
98 padding: 0 16px 8px;
99}
100
101.year-grid {
102 padding: 4px 20px 8px 12px;
103 overscroll-behavior: contain;
104}
105`;