2 * MediaWiki Widgets – CalendarWidget styles.
4 * @copyright 2011-2023 MediaWiki Widgets Team and others; see AUTHORS.txt
5 * @license The MIT License (MIT); see LICENSE.txt
8 /* stylelint-disable no-duplicate-selectors */
9 @import 'mediawiki.skin.variables.less';
10 @import 'mediawiki.mixins.less';
13 @calendarHeight: 14em;
15 .mw-widget-calendarWidget {
16 width: @calendarWidth;
19 .mw-widget-calendarWidget-header {
23 // Overwrite OOUI's `.oo-ui-buttonElement-frameless.oo-ui-iconElement:first-child`
24 .oo-ui-buttonWidget.oo-ui-iconElement {
29 .mw-widget-calendarWidget-labelButton {
32 width: @calendarWidth - 2 * 3em;
34 .oo-ui-buttonElement-button {
35 width: @calendarWidth - 2 * 3em;
41 .mw-widget-calendarWidget-upButton {
48 .mw-widget-calendarWidget-prevButton {
52 .mw-widget-calendarWidget-nextButton {
56 .mw-widget-calendarWidget-body-outer-wrapper {
60 // Fit 7 days, 3em each
61 width: @calendarWidth;
62 // Fit 6 weeks + heading line, 2em each
63 height: @calendarHeight;
66 .mw-widget-calendarWidget-body-wrapper {
67 .mw-widget-calendarWidget-body {
68 display: inline-block;
70 // Fit 7 days, 3em each
71 width: @calendarWidth;
72 // Fit 6 weeks + heading line, 2em each
73 height: @calendarHeight;
76 .mw-widget-calendarWidget-body:not( .mw-widget-calendarWidget-old-body ):first-child {
77 margin-top: -@calendarHeight;
78 margin-left: -@calendarWidth;
81 .mw-widget-calendarWidget-body:not( .mw-widget-calendarWidget-old-body ):last-child {
87 .mw-widget-calendarWidget-body-wrapper-fade-previous {
88 width: @calendarWidth * 2;
89 height: @calendarHeight;
91 /* stylelint-disable declaration-no-important */
92 .mw-widget-calendarWidget-body:first-child {
93 margin-top: 0 !important;
94 margin-left: 0 !important;
95 transition: margin-left 500ms;
97 /* stylelint-enable declaration-no-important */
100 .mw-widget-calendarWidget-body-wrapper-fade-next {
101 width: @calendarWidth * 2;
102 height: @calendarHeight;
104 /* stylelint-disable declaration-no-important */
105 .mw-widget-calendarWidget-body:first-child {
106 margin-left: -@calendarWidth !important;
107 margin-top: 0 !important;
108 transition: margin-left 500ms;
110 /* stylelint-enable declaration-no-important */
113 .mw-widget-calendarWidget-body-wrapper-fade-up {
114 width: @calendarWidth;
115 height: @calendarHeight * 2;
117 .mw-widget-calendarWidget-body {
122 /* stylelint-disable declaration-no-important */
123 .mw-widget-calendarWidget-body:first-child {
124 margin-left: 0 !important;
125 margin-top: 0 !important;
126 transition: margin-top 500ms;
128 /* stylelint-enable declaration-no-important */
131 .mw-widget-calendarWidget-body-wrapper-fade-down {
132 width: @calendarWidth;
133 height: @calendarHeight * 2;
135 .mw-widget-calendarWidget-body {
140 /* stylelint-disable declaration-no-important */
141 .mw-widget-calendarWidget-body:first-child {
142 margin-left: 0 !important;
143 margin-top: -@calendarHeight !important;
144 transition: margin-top 500ms;
146 /* stylelint-enable declaration-no-important */
149 // Support: Browsers that render CSS Grid. All others ignore unknown `grid-*` properties.
150 // This avoids any calculation issues pushing items to next line.
151 .mw-widget-calendarWidget-body-month {
152 grid-template-columns: auto auto auto auto auto auto auto;
155 .mw-widget-calendarWidget-body-year {
156 grid-template-columns: auto auto;
159 .mw-widget-calendarWidget-body-duodecade {
160 grid-template-columns: auto auto auto auto auto;
163 .mw-widget-calendarWidget-day,
164 .mw-widget-calendarWidget-day-heading,
165 .mw-widget-calendarWidget-month,
166 .mw-widget-calendarWidget-year {
167 display: inline-block;
168 vertical-align: middle;
171 text-overflow: ellipsis;
175 .mw-widget-calendarWidget-day,
176 .mw-widget-calendarWidget-day-heading {
178 width: (@calendarWidth / 7);
179 line-height: (@calendarHeight / 7);
181 // Don't overlap the hacked-up fake box-shadow border we get when focussed
183 width: (@calendarWidth / 7 - 0.2em);
187 &:nth-child( 7n+1 ) {
188 width: (@calendarWidth / 7 - 0.2em);
192 &:nth-child( 42 ) ~ & {
193 line-height: (@calendarHeight / 7 - 0.2em);
194 margin-bottom: 0.2em;
198 .mw-widget-calendarWidget-month {
200 width: (@calendarWidth / 2);
201 line-height: (@calendarHeight / 6);
203 // Don't overlap the hacked-up fake box-shadow border we get when focussed
205 width: (@calendarWidth / 2 - 0.2em);
209 &:nth-child( 2n+1 ) {
210 width: (@calendarWidth / 2 - 0.2em);
214 &:nth-child( 10 ) ~ & {
215 line-height: (@calendarHeight / 6 - 0.2em);
216 margin-bottom: 0.2em;
220 .mw-widget-calendarWidget-year {
222 width: (@calendarWidth / 5);
223 line-height: (@calendarHeight / 4);
225 // Don't overlap the hacked-up fake box-shadow border we get when focussed
227 width: (@calendarWidth / 5 - 0.2em);
231 &:nth-child( 5n+1 ) {
232 width: (@calendarWidth / 5 - 0.2em);
236 &:nth-child( 15 ) ~ & {
237 line-height: (@calendarHeight / 4 - 0.2em);
238 margin-bottom: 0.2em;
242 .mw-widget-calendarWidget-item {
247 .mw-widget-calendarWidget {
248 box-sizing: border-box;
249 border: @border-base;
250 transition: border-color 100ms, box-shadow 100ms;
253 border-color: @border-color-progressive--focus;
254 box-shadow: @box-shadow-inset-small @box-shadow-color-progressive--focus;
255 outline: @outline-base--focus;
260 border-radius: @border-radius-base;
264 color: @color-subtle;
277 box-shadow: @box-shadow-inset-small @box-shadow-color-progressive-selected;
281 transition: background-color 250ms, color 250ms;
284 background-color: #36c;
289 background-color: #2a4b8d;