-
Notifications
You must be signed in to change notification settings - Fork 5
/
style.postcss
100 lines (79 loc) · 1.57 KB
/
style.postcss
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
:host {
--_active-day-background: var(--active-day-background, var(--accent-color, hsl(220 60% 50%)));
--_inactive-day-background: var(--inactive-day-background, hsl(220 10% 70%));
display: grid;
grid-template-columns: repeat(7, 1fr);
grid-gap: .2em;
}
:host([rows=months]) {
grid-template-columns: auto repeat(31, 1fr);
& #headers {
font-weight: normal;
& :first-child {
grid-column: 2;
}
}
}
#calendar {
display: contents;
}
#headers {
display: contents;
color: hsl(var(--gray), 50%);
font-weight: bold;
text-align: center;
}
[part~="month"] {
grid-column: 1;
font-weight: bold;
text-transform: uppercase;
color: var(--_inactive-day-background);
filter: brightness(80%);
align-self: center;
font-size: 75%;
}
[part~="day"] {
position: relative;
border-radius: .2em;
background: var(--_inactive-day-background);
color: white;
font-weight: bold;
text-decoration: none;
overflow: hidden;
padding: .2em 0;
text-align: center;
container-type: inline-size;
&[part~="active"] {
background: var(--_active-day-background);
}
&::after {
counter-reset: day var(--day);
content: counter(day);
}
@container (max-width: 4em) {
&::before {
display: block;
font-size: 70%;
}
&::after {
display: block;
}
}
@nest :host(:not([rows=months])) & {
grid-column: var(--weekday);
&::before {
content: var(--month) " ";
font-weight: 300;
}
}
@nest :host([rows=months]) & {
font-size: 90%;
letter-spacing: -.03em;
grid-column: calc(var(--day) + 1);
}
}
:host(:not([rows=months])) {
& [part~="month"] {
display: none;
}
}