3 @import "mediawiki.mixins";
4 @import "mediawiki.ui/variables";
5 @import "mediawiki.ui/mixins";
9 // Apply the mw-ui-input class to input and textarea fields.
15 // Style an input using MediaWiki UI.
16 // Currently in draft status and subject to change.
17 // When focused a progressive highlight appears to the left of the field.
20 // <input class="mw-ui-input" placeholder="Enter your name">
21 // <textarea class="mw-ui-input">Text here</textarea>
25 background-color: #fff;
26 .box-sizing( border-box );
29 border: 1px solid @colorFieldBorder;
30 border-radius: @borderRadius;
31 padding: 0.3em 0.3em 0.3em 0.6em;
32 // necessary for smooth transition
33 box-shadow: inset 0 0 0 0.1em #fff;
37 vertical-align: middle;
39 // Normalize & style placeholder text, see T139034
40 // Placeholder styles can't be grouped, otherwise they're ignored as invalid.
43 .mixin-placeholder() {
48 &:-moz-placeholder { // stylelint-disable-line selector-no-vendor-prefix
53 &::-moz-placeholder { // stylelint-disable-line selector-no-vendor-prefix
57 // Internet Explorer 10-11
58 &:-ms-input-placeholder { // stylelint-disable-line selector-no-vendor-prefix
61 // WebKit, Blink, Edge
62 // Don't set `opacity < 1`, see https://developer.microsoft.com/en-us/microsoft-edge/platform/issues/3901363/
63 &::-webkit-input-placeholder { // stylelint-disable-line selector-no-vendor-prefix
66 // W3C Standard Selectors Level 4
71 // Firefox: Remove red outline when `required` attribute set and invalid content.
72 // See https://developer.mozilla.org/en-US/docs/Web/CSS/:invalid
73 // This should come before `:focus` so latter rules take preference.
79 border-color: @colorGray7;
83 border-color: @colorProgressive;
84 box-shadow: inset 0 0 0 1px @colorProgressive;
88 // `:not()` is used exclusively for `transition`s as both are not supported by IE < 9.
90 .transition( ~'color 100ms, border-color 100ms, box-shadow 100ms' );
94 border-color: @colorGray14;
98 // Normalize styling for `<input type="search">`
100 // Correct the odd appearance in Chrome and Safari 5
101 -webkit-appearance: textfield;
103 // Remove proprietary clear button in IE 10-11, Edge 12+
108 // Remove the inner padding and cancel buttons in Chrome on OS X and Safari on OS X
109 &::-webkit-search-cancel-button,
110 &::-webkit-search-decoration {
111 -webkit-appearance: none;
116 textarea.mw-ui-input {
120 // mw-ui-input-inline
122 // Use mw-ui-input-inline with mw-ui-input in cases where you want a button to line up with the input.
125 // <input class="mw-ui-input mw-ui-input-inline">
126 // <button class="mw-ui-button mw-ui-progressive">Submit</button>
129 input[type="number"],
130 .mw-ui-input-inline {
131 display: inline-block;
133 // Make sure we limit `width` to parent element because
134 // in case of text `input` fields, `width: auto;` equals `size` attribute.
140 // Use mw-ui-input-large with mw-ui-input in cases where there are multiple inputs on a screen and you
141 // want to draw attention to one instance. For example, replying with a subject line and more text.
142 // Currently in draft status and subject to change. When used on an input field, the text is styled
143 // in a large font. When used alongside another mw-ui-input large they are pushed together to form one
147 // <input value="input" class="mw-ui-input mw-ui-input-large" value="input" placeholder="Enter subject">
148 // <textarea class="mw-ui-input mw-ui-input-large" placeholder="Provide additional details"></textarea>
155 // When two large inputs are together, we make them flush by hiding one of the borders
156 & + .mw-ui-input-large {
159 // When focusing, make the input relative to raise it above any attached inputs to unhide its borders
165 input.mw-ui-input-large {