summaryrefslogtreecommitdiff
path: root/resources/src/mediawiki.widgets/mw.widgets.CalendarWidget.less
blob: 9d30eb8a1f7b0c7aacdcc1931977d2440514befb (plain)
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
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
/*!
 * MediaWiki Widgets – CalendarWidget styles.
 *
 * @copyright 2011-2015 MediaWiki Widgets Team and others; see AUTHORS.txt
 * @license The MIT License (MIT); see LICENSE.txt
 */

@calendarWidth: 21em;
@calendarHeight: 14em;

.mw-widget-calendarWidget {
	width: @calendarWidth;
}

.mw-widget-calendarWidget-header {
	position: relative;
	line-height: 2.5em;
}

.mw-widget-calendarWidget-header .oo-ui-buttonWidget {
	margin-right: 0;
}

.mw-widget-calendarWidget-header .mw-widget-calendarWidget-labelButton {
	margin: 0 auto;
	display: block;
	width: @calendarWidth - 2*3em;

	.oo-ui-buttonElement-button {
		width: @calendarWidth - 2*3em;
		text-align: center;
	}
}

.mw-widget-calendarWidget-upButton {
	position: absolute;
	right: 3em;
}

.mw-widget-calendarWidget-prevButton {
	float: left;
}

.mw-widget-calendarWidget-nextButton {
	float: right;
}

.mw-widget-calendarWidget-body-outer-wrapper {
	clear: both;
	position: relative;
	overflow: hidden;
	// Fit 7 days, 3em each
	width: @calendarWidth;
	// Fit 6 weeks + heading line, 2em each
	height: @calendarHeight;
}

.mw-widget-calendarWidget-body-wrapper {
	.mw-widget-calendarWidget-body {
		display: inline-block;
		// Fit 7 days, 3em each
		width: @calendarWidth;
		// Fit 6 weeks + heading line, 2em each
		height: @calendarHeight;
	}

	.mw-widget-calendarWidget-old-body {
		// background: #fdd;
	}

	.mw-widget-calendarWidget-body:not(.mw-widget-calendarWidget-old-body):first-child {
		margin-top: -@calendarHeight;
		margin-left: -@calendarWidth;
	}

	.mw-widget-calendarWidget-body:not(.mw-widget-calendarWidget-old-body):last-child {
		margin-top: 0;
		margin-left: 0;
	}
}

.mw-widget-calendarWidget-body-wrapper-fade-previous {
	width: @calendarWidth * 2;
	height: @calendarHeight;

	.mw-widget-calendarWidget-body:first-child {
		margin-top: 0 !important;
		margin-left: 0 !important;
		transition: 0.5s margin-left;
	}
}

.mw-widget-calendarWidget-body-wrapper-fade-next {
	width: @calendarWidth * 2;
	height: @calendarHeight;

	.mw-widget-calendarWidget-body:first-child {
		margin-left: -@calendarWidth !important;
		margin-top: 0 !important;
		transition: 0.5s margin-left;
	}
}

.mw-widget-calendarWidget-body-wrapper-fade-up {
	width: @calendarWidth;
	height: @calendarHeight * 2;

	.mw-widget-calendarWidget-body {
		display: block;
	}

	.mw-widget-calendarWidget-body:first-child {
		margin-left: 0 !important;
		margin-top: 0 !important;
		transition: 0.5s margin-top;
	}
}

.mw-widget-calendarWidget-body-wrapper-fade-down {
	width: @calendarWidth;
	height: @calendarHeight * 2;

	.mw-widget-calendarWidget-body {
		display: block;
	}

	.mw-widget-calendarWidget-body:first-child {
		margin-left: 0 !important;
		margin-top: -@calendarHeight !important;
		transition: 0.5s margin-top;
	}
}

.mw-widget-calendarWidget-day,
.mw-widget-calendarWidget-day-heading,
.mw-widget-calendarWidget-month,
.mw-widget-calendarWidget-year {
	display: inline-block;
	vertical-align: middle;
	white-space: nowrap;
	overflow: hidden;
	text-overflow: ellipsis;
	text-align: center;
}

.mw-widget-calendarWidget-day,
.mw-widget-calendarWidget-day-heading {
	// 7x7 grid
	width: @calendarWidth / 7;
	line-height: @calendarHeight / 7;
	// Don't overlap the hacked-up fake box-shadow border we get when focussed
	&:nth-child(7n) {
		width: @calendarWidth / 7 - 0.2em;
		margin-right: 0.2em;
	}
	&:nth-child(7n+1) {
		width: @calendarWidth / 7 - 0.2em;
		margin-left: 0.2em;
	}
	&:nth-child(42) ~ & {
		line-height: @calendarHeight / 7 - 0.2em;
		margin-bottom: 0.2em;
	}
}

.mw-widget-calendarWidget-month {
	// 2x6 grid
	width: @calendarWidth / 2;
	line-height: @calendarHeight / 6;
	// Don't overlap the hacked-up fake box-shadow border we get when focussed
	&:nth-child(2n) {
		width: @calendarWidth / 2 - 0.2em;
		margin-right: 0.2em;
	}
	&:nth-child(2n+1) {
		width: @calendarWidth / 2 - 0.2em;
		margin-left: 0.2em;
	}
	&:nth-child(10) ~ & {
		line-height: @calendarHeight / 6 - 0.2em;
		margin-bottom: 0.2em;
	}
}

.mw-widget-calendarWidget-year {
	// 5x4 grid
	width: @calendarWidth / 5;
	line-height: @calendarHeight / 4;
	// Don't overlap the hacked-up fake box-shadow border we get when focussed
	&:nth-child(5n) {
		width: @calendarWidth / 5 - 0.2em;
		margin-right: 0.2em;
	}
	&:nth-child(5n+1) {
		width: @calendarWidth / 5 - 0.2em;
		margin-left: 0.2em;
	}
	&:nth-child(15) ~ & {
		line-height: @calendarHeight / 4 - 0.2em;
		margin-bottom: 0.2em;
	}
}

.mw-widget-calendarWidget-item {
	cursor: pointer;
}

/* Theme-specific */
.mw-widget-calendarWidget {
	box-shadow: inset 0 0 0 1px #ccc;
}

.mw-widget-calendarWidget:focus {
	outline: none;
	box-shadow: inset 0 0 0 2px #347bff;
}

.mw-widget-calendarWidget-day {
	color: #444;
	border-radius: 0.1em;
}

.mw-widget-calendarWidget-day-heading {
	font-weight: bold;
	color: #555;
}

.mw-widget-calendarWidget-day-additional {
	color: #aaa;
}

.mw-widget-calendarWidget-day-today {
	box-shadow: inset 0 0 0 1px #3787fb;
}

.mw-widget-calendarWidget-item-selected {
	background-color: #d8e6fe;
	color: #3787fb;
}

.mw-widget-calendarWidget-item:hover {
	background-color: #eee;
}