2 * MediaWiki Widgets – PHP DateInputWidget styles.
4 * @copyright 2011-2015 MediaWiki Widgets Team and others; see AUTHORS.txt
5 * @license The MIT License (MIT); see LICENSE.txt
7 @import 'mediawiki.skin.variables.less';
9 // Variables taken from OOUI's WikimediaUI theme
10 @ooui-font-size-browser: 16; // assumed browser default of `16px`
11 @ooui-font-size-base: 0.875em; // equals `14px` at browser default of `16px`
14 @padding-input-text: @padding-vertical-base @padding-horizontal-input-text;
15 @padding-horizontal-input-text: 8px;
16 @padding-vertical-base: 6px;
18 // `line-height` has to be relative/in `em` to enable user override in browser settings.
19 @line-height-widget-base: unit( 18 / @ooui-font-size-browser / @ooui-font-size-base, @ooui-unit ); // equals `18px` at base `font-size: 14px;
21 .oo-ui-inline-spacing( @spacing, @cancelled-spacing: 0 ) {
22 margin-right: @spacing;
25 margin-right: @cancelled-spacing;
29 // DateInputWidget rules
30 .mw-widget-dateInputWidget {
31 &.oo-ui-textInputWidget {
32 display: inline-block;
34 // .oo-ui-inline-spacing( 0.5em ); already inherited from `.oo-ui-inputWidget`
36 .oo-ui-labelElement-label {
37 line-height: @line-height-widget-base;
41 // Note that this block applies to both the PHP widget and the JS widget
43 &.oo-ui-textInputWidget input {
44 display: inline-block;
48 * Ensures non-infused and infused widget have the same height.
49 * Equal to line height + top padding + bottom padding
54 // Ensure `.mw-widget-dateInputWidget-handle` similar appearance to OOUI's `.oo-ui-textInputWidget`
56 background-color: @background-color-base;
57 color: @color-emphasized;
58 box-sizing: border-box;
61 border-radius: @border-radius-base;
62 padding: @padding-input-text;
63 line-height: @line-height-widget-base;
66 &.oo-ui-widget-enabled {
67 .mw-widget-dateInputWidget-handle {
68 // `transparent` necessary for smooth transition
69 box-shadow: @box-shadow-inset-small @box-shadow-color-transparent;
70 transition-property: border-color, box-shadow;
71 transition-duration: @transition-duration-medium;
74 border-color: @border-color-input--hover;
78 outline: @outline-base--focus;
79 border-color: @border-color-progressive--focus;
80 box-shadow: @box-shadow-inset-small @box-shadow-color-progressive--focus;
83 & > .oo-ui-labelElement-label {
90 &.oo-ui-textInputWidget input {
96 // Pending state (T382186)
97 .client-nojs .mw-widget-dateInputWidget .mw-widgets-pendingTextInputWidget,
98 .client-js .mw-widget-dateInputWidget input[ type='date' ] {