Merge "Make mediawiki.action.view.dblClickEdit recheck preference"
[lhc/web/wiklou.git] / resources / src / mediawiki.ui / components / inputs.less
1 // Inputs
2
3 @import "mediawiki.mixins";
4 @import "mediawiki.ui/variables";
5 @import "mediawiki.ui/mixins";
6
7 // Placeholder text styling helper
8 .field-placeholder-styling() {
9 font-style: italic;
10 font-weight: normal;
11 }
12 // Inputs
13 //
14 // Apply the mw-ui-input class to input and textarea fields.
15 //
16 // Styleguide 1.
17
18 // mw-ui-input
19 //
20 // Style an input using MediaWiki UI.
21 // Currently in draft status and subject to change.
22 // When focused a progressive highlight appears to the left of the field.
23 //
24 // Markup:
25 // <input class="mw-ui-input" placeholder="Enter your name">
26 // <textarea class="mw-ui-input">Text here</textarea>
27 //
28 // Styleguide 1.1.
29 .mw-ui-input {
30 // turn off default input styling for input[type="search"] fields
31 -webkit-appearance: none;
32 border: 1px solid @colorFieldBorder;
33 .box-sizing(border-box);
34 width: 100%;
35 padding: .4em .3em .2em .6em;
36 display: block;
37 vertical-align: middle;
38 border-radius: @borderRadius;
39 // Override user agent stylesheet properties. Instead use parent element.
40 color: inherit;
41 font-family: inherit;
42 font-size: inherit;
43 line-height: inherit;
44 .transition(~"border linear .2s, box-shadow linear .2s");
45
46 // Placeholder text styling must be set individually for each browser @winter
47 &::-webkit-input-placeholder { // webkit
48 .field-placeholder-styling;
49 }
50 &::-moz-placeholder { // FF 4-18
51 .field-placeholder-styling;
52 }
53 &:-moz-placeholder { // FF >= 19
54 .field-placeholder-styling;
55 }
56 &:-ms-input-placeholder { // IE >= 10
57 .field-placeholder-styling;
58 }
59
60 // Remove red outline from inputs which have required field and invalid content.
61 // This is a Firefox only issue
62 // See https://developer.mozilla.org/en-US/docs/Web/CSS/:invalid
63 // This should be above :focus so focus behaviour takes preference
64 &:invalid {
65 box-shadow: none;
66 }
67
68 &:focus {
69 box-shadow: inset .45em 0 0 @colorProgressive;
70 border-color: @colorGrayDark;
71 // Remove focus glow on input[type="search"]
72 outline: 0;
73 }
74
75 &:disabled {
76 border-color: @colorGray14;
77 color: @colorGray12;
78 }
79 }
80
81 textarea.mw-ui-input {
82 min-height: 8em;
83 }
84
85 // mw-ui-input-inline
86 //
87 // Use mw-ui-input-inline with mw-ui-input in cases where you want a button to line up with the input.
88 //
89 // Markup:
90 // <input class="mw-ui-input mw-ui-input-inline">
91 // <button class="mw-ui-button mw-ui-constructive">go</button>
92 //
93 // Styleguide 1.2.
94 input[type="number"],
95 .mw-ui-input-inline {
96 display: inline-block;
97 width: auto;
98 }
99
100 // mw-ui-input-large
101 //
102 // Use mw-ui-input-large with mw-ui-input in cases where there are multiple inputs on a screen and you
103 // want to draw attention to one instance. For example, replying with a subject line and more text.
104 // Currently in draft status and subject to change. When used on an input field, the text is styled
105 // in a large font. When used alongside another mw-ui-input large they are pushed together to form one
106 // contiguous block.
107 //
108 // Markup:
109 // <input value="input" class="mw-ui-input mw-ui-input-large" value="input" placeholder="Enter subject">
110 // <textarea class="mw-ui-input mw-ui-input-large" placeholder="Provide additional details"></textarea>
111 //
112 // Styleguide 1.3.
113 .mw-ui-input-large {
114 margin-top: 0;
115 margin-bottom: 0;
116
117 // When two large inputs are together, we make them flush by hiding one of the borders
118 & + .mw-ui-input-large {
119 margin-top: -1px;
120 }
121 // When focusing, make the input relative to raise it above any attached inputs to unhide its borders
122 &:focus {
123 position: relative;
124 }
125 }
126
127 input.mw-ui-input-large {
128 font-size: 1.75em;
129 font-weight: bold;
130 line-height: 1.25em;
131 }