| 1 |
@import 'mediawiki.widgets.datetime.definitions'; |
| 2 |
|
| 3 |
.mw-widgets-datetime-dateTimeInputWidget { |
| 4 |
display: inline-block; |
| 5 |
position: relative; |
| 6 |
width: 100%; |
| 7 |
// Hack: Set maximum width equivalent to DateInputWidgets calendar popup |
| 8 |
max-width: 24.275em; |
| 9 |
.oo-ui-inline-spacing( 0.5em ); |
| 10 |
vertical-align: middle; |
| 11 |
|
| 12 |
&-fields { |
| 13 |
position: relative; |
| 14 |
display: table; |
| 15 |
z-index: 2; |
| 16 |
.oo-ui-unselectable(); |
| 17 |
|
| 18 |
> .mw-widgets-datetime-dateTimeInputWidget-field { |
| 19 |
display: table-cell; |
| 20 |
white-space: pre; |
| 21 |
} |
| 22 |
} |
| 23 |
|
| 24 |
&-handle { |
| 25 |
background-color: @background-color-base; |
| 26 |
color: @color-base; |
| 27 |
display: inline-block; |
| 28 |
box-sizing: border-box; |
| 29 |
width: 100%; |
| 30 |
height: @size-base; |
| 31 |
border: @border-base; |
| 32 |
border-radius: @border-radius-base; |
| 33 |
padding: 0 @padding-horizontal-input-text; |
| 34 |
box-shadow: inset 0 0 0 0 @box-shadow-color-progressive--focus; |
| 35 |
// Needed for proper behavior with `overflow: hidden`. |
| 36 |
vertical-align: bottom; |
| 37 |
overflow: hidden; |
| 38 |
.oo-ui-unselectable(); |
| 39 |
transition: box-shadow @transition-duration-base; |
| 40 |
|
| 41 |
> .oo-ui-iconElement-icon, |
| 42 |
> .oo-ui-indicatorElement-indicator { |
| 43 |
background-position: center center; |
| 44 |
background-repeat: no-repeat; |
| 45 |
position: absolute; |
| 46 |
top: 0; |
| 47 |
z-index: 1; |
| 48 |
} |
| 49 |
|
| 50 |
> .oo-ui-iconElement-icon { |
| 51 |
left: @padding-start-input-text-icon; |
| 52 |
width: @size-icon; |
| 53 |
height: @size-icon; |
| 54 |
} |
| 55 |
|
| 56 |
> .oo-ui-indicatorElement-indicator { |
| 57 |
right: @padding-horizontal-base; |
| 58 |
} |
| 59 |
} |
| 60 |
|
| 61 |
&.oo-ui-iconElement .mw-widgets-datetime-dateTimeInputWidget-handle { |
| 62 |
padding-left: @padding-start-input-text-icon-label; |
| 63 |
} |
| 64 |
|
| 65 |
&.oo-ui-indicatorElement .mw-widgets-datetime-dateTimeInputWidget-handle { |
| 66 |
padding-right: @min-size-indicator + 2 * @padding-horizontal-input-text; |
| 67 |
} |
| 68 |
|
| 69 |
&-field { |
| 70 |
background-color: transparent; |
| 71 |
color: inherit; |
| 72 |
box-sizing: content-box; |
| 73 |
border: 0; |
| 74 |
border-radius: @border-radius-base; |
| 75 |
padding-top: @padding-vertical-base; |
| 76 |
padding-bottom: @padding-vertical-base; |
| 77 |
box-shadow: none; |
| 78 |
font-size: inherit; |
| 79 |
font-family: inherit; |
| 80 |
line-height: @line-height-widget-base; |
| 81 |
text-align: center; |
| 82 |
vertical-align: top; |
| 83 |
|
| 84 |
// Day field, f.e. “Sat” |
| 85 |
&:first-child { |
| 86 |
cursor: pointer; |
| 87 |
} |
| 88 |
|
| 89 |
// Day field & time zome field, f.e. “Sat” & “Z” |
| 90 |
&[ tabindex='-1' ] { |
| 91 |
// Support: Firefox, Chrome |
| 92 |
outline: 0; |
| 93 |
} |
| 94 |
} |
| 95 |
|
| 96 |
&-editField { |
| 97 |
.mw-widgets-datetime-dateTimeInputWidget-invalid { |
| 98 |
border: @border-width-base @border-style-base @border-color-error; |
| 99 |
box-shadow: @box-shadow-inset-small @box-shadow-color-transparent; |
| 100 |
|
| 101 |
&:focus { |
| 102 |
border: @border-width-base @border-style-base @border-color-error; |
| 103 |
box-shadow: @box-shadow-inset-small @color-error; |
| 104 |
} |
| 105 |
} |
| 106 |
} |
| 107 |
|
| 108 |
&-clearButton { |
| 109 |
// Override `&-field` from above |
| 110 |
padding-top: 0; |
| 111 |
padding-bottom: 0; |
| 112 |
padding-left: @padding-start-button-clear; |
| 113 |
|
| 114 |
// `&.oo-ui-iconElement` needed for specificity |
| 115 |
&.oo-ui-iconElement > .oo-ui-buttonElement-button { |
| 116 |
padding-top: @padding-top-button-clear; |
| 117 |
} |
| 118 |
|
| 119 |
.oo-ui-iconElement-icon { |
| 120 |
background-size: @size-indicator @size-indicator; |
| 121 |
} |
| 122 |
} |
| 123 |
|
| 124 |
&-empty { |
| 125 |
.mw-widgets-datetime-dateTimeInputWidget-handle { |
| 126 |
color: @color-subtle; |
| 127 |
} |
| 128 |
|
| 129 |
.mw-widgets-datetime-dateTimeInputWidget-clearButton { |
| 130 |
display: none; |
| 131 |
} |
| 132 |
} |
| 133 |
|
| 134 |
&.oo-ui-widget-enabled { |
| 135 |
.mw-widgets-datetime-dateTimeInputWidget-handle { |
| 136 |
transition-property: border-color; |
| 137 |
transition-duration: @transition-duration-medium; |
| 138 |
|
| 139 |
&:hover { |
| 140 |
border-color: @border-color-input--hover; |
| 141 |
} |
| 142 |
} |
| 143 |
|
| 144 |
// Set on widget parent to also enable `:hover` on child elements |
| 145 |
&:hover { |
| 146 |
input, |
| 147 |
textarea { |
| 148 |
border-color: @border-color-input--hover; |
| 149 |
} |
| 150 |
} |
| 151 |
|
| 152 |
.mw-widgets-datetime-dateTimeInputWidget-editField:hover { |
| 153 |
background-color: @background-color-interactive; |
| 154 |
} |
| 155 |
|
| 156 |
.mw-widgets-datetime-dateTimeInputWidget-editField:focus { |
| 157 |
outline: @outline-base--focus; |
| 158 |
box-shadow: @box-shadow-inset-small @box-shadow-color-progressive--focus, @box-shadow-outset-small @box-shadow-color-progressive--focus; |
| 159 |
} |
| 160 |
|
| 161 |
&.oo-ui-flaggedElement-invalid { |
| 162 |
.mw-widgets-datetime-dateTimeInputWidget-handle { |
| 163 |
border-color: @border-color-error; |
| 164 |
box-shadow: @box-shadow-inset-small @box-shadow-color-transparent; |
| 165 |
|
| 166 |
&:focus { |
| 167 |
border-color: @border-color-error; |
| 168 |
box-shadow: @box-shadow-inset-small @color-error; |
| 169 |
} |
| 170 |
} |
| 171 |
} |
| 172 |
} |
| 173 |
|
| 174 |
&.oo-ui-widget-disabled { |
| 175 |
.mw-widgets-datetime-dateTimeInputWidget-handle { |
| 176 |
background-color: @background-color-disabled-subtle; |
| 177 |
// Support: Safari |
| 178 |
-webkit-text-fill-color: @color-disabled; |
| 179 |
color: @color-disabled; |
| 180 |
border-color: @border-color-disabled; |
| 181 |
text-shadow: @text-shadow-base--disabled; |
| 182 |
} |
| 183 |
|
| 184 |
> .oo-ui-iconElement-icon, |
| 185 |
> .oo-ui-indicatorElement-indicator { |
| 186 |
opacity: @opacity-icon-base--disabled; |
| 187 |
} |
| 188 |
} |
| 189 |
} |