-
Notifications
You must be signed in to change notification settings - Fork 6.7k
/
calendar.scss
128 lines (104 loc) · 3.1 KB
/
calendar.scss
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
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
@use '../core/style/layout-common';
$calendar-padding: 8px !default;
$calendar-header-divider-width: 1px !default;
$calendar-controls-vertical-padding: 5%;
// We use the same padding as the month / year label, but subtract 16px since there is padding
// between the edge of the button and the text. This ensures that the button text lines up with
// the month / year label text.
$calendar-controls-side-margin: calc(33% / 7 - 16px);
$calendar-arrow-size: 5px !default;
$calendar-arrow-disabled-opacity: 0.5 !default;
// Values chosen to approximate https://material.io/icons/#ic_navigate_before and
// https://material.io/icons/#ic_navigate_next as closely as possible.
$calendar-prev-next-icon-border-width: 2px;
$calendar-prev-next-icon-margin: 15.5px;
$calendar-prev-icon-transform: translateX(2px) rotate(-45deg);
$calendar-next-icon-transform: translateX(-2px) rotate(45deg);
.mat-calendar {
display: block;
}
.mat-calendar-header {
padding: $calendar-padding $calendar-padding 0 $calendar-padding;
}
.mat-calendar-content {
padding: 0 $calendar-padding $calendar-padding $calendar-padding;
outline: none;
}
.mat-calendar-controls {
display: flex;
margin: $calendar-controls-vertical-padding $calendar-controls-side-margin;
.mat-icon-button:hover .mat-button-focus-overlay {
opacity: 0.04;
}
}
.mat-calendar-spacer {
flex: 1 1 auto;
}
.mat-calendar-period-button {
min-width: 0;
}
.mat-calendar-arrow {
display: inline-block;
width: 0;
height: 0;
border-left: $calendar-arrow-size solid transparent;
border-right: $calendar-arrow-size solid transparent;
border-top-width: $calendar-arrow-size;
border-top-style: solid;
margin: 0 0 0 $calendar-arrow-size;
vertical-align: middle;
&.mat-calendar-invert {
transform: rotate(180deg);
}
[dir='rtl'] & {
margin: 0 $calendar-arrow-size 0 0;
}
}
.mat-calendar-previous-button,
.mat-calendar-next-button {
position: relative;
&::after {
@include layout-common.fill;
content: '';
margin: $calendar-prev-next-icon-margin;
border: 0 solid currentColor;
border-top-width: $calendar-prev-next-icon-border-width;
}
[dir='rtl'] & {
transform: rotate(180deg);
}
}
.mat-calendar-previous-button::after {
border-left-width: $calendar-prev-next-icon-border-width;
transform: $calendar-prev-icon-transform;
}
.mat-calendar-next-button::after {
border-right-width: $calendar-prev-next-icon-border-width;
transform: $calendar-next-icon-transform;
}
.mat-calendar-table {
border-spacing: 0;
border-collapse: collapse;
width: 100%;
}
.mat-calendar-table-header th {
text-align: center;
padding: 0 0 $calendar-padding 0;
}
.mat-calendar-table-header-divider {
position: relative;
height: $calendar-header-divider-width;
// We use an absolutely positioned pseudo-element as the divider line for the table header so we
// can extend it all the way to the edge of the calendar.
&::after {
content: '';
position: absolute;
top: 0;
left: -$calendar-padding;
right: -$calendar-padding;
height: $calendar-header-divider-width;
}
}
.mat-calendar-abbr {
text-decoration: none;
}