Merge "Shorten ternary expressions in RawAction.php"
[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 // When using an input or textarea apply the mw-ui-input class.
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 value="input" class="mw-ui-input" value="input">
26 // <textarea class="mw-ui-input">textarea</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: .3em .3em .3em .6em;
36 display: block;
37 // Override user agent stylesheet properties. Instead use parent element.
38 color: inherit;
39 font-family: inherit;
40 font-size: inherit;
41 line-height: inherit;
42 .transition(~"border linear .2s, box-shadow linear .2s");
43
44 // Placeholder text styling must be set individually for each browser @winter
45 &::-webkit-input-placeholder { // webkit
46 .field-placeholder-styling;
47 }
48 &::-moz-placeholder { // FF 4-18
49 .field-placeholder-styling;
50 }
51 &:-moz-placeholder { // FF >= 19
52 .field-placeholder-styling;
53 }
54 &:-ms-input-placeholder { // IE >= 10
55 .field-placeholder-styling;
56 }
57
58 &:focus {
59 box-shadow: inset .45em 0 0 #5088f7;
60 border-color: @colorGrayDark;
61 // Remove focus glow on input[type="search"]
62 outline: 0;
63 }
64 }
65
66 textarea.mw-ui-input {
67 min-height: 8em;
68 }
69
70 // mw-ui-input-inline
71 //
72 // Use mw-ui-input-inline with mw-ui-input in cases where you want a button to line up with the input.
73 //
74 // Markup:
75 // <input value="input" class="mw-ui-input mw-ui-input-inline" value="input">
76 // <button class="mw-ui-button mw-ui-constructive">go</button>
77 //
78 // Styleguide 1.2.
79 .mw-ui-input-inline {
80 display: inline-block;
81 width: auto;
82 }
83
84 // mw-ui-input-large
85 //
86 // Use mw-ui-input-large with mw-ui-input in cases where there are multiple inputs on a screen and you
87 // want to draw more attention to one instance. For example add topic / reply to post forms.
88 // Currently in draft status and subject to change. When used on an input, the text is styled
89 // in a large font. When used alongside another mw-ui-input large they are pushed together to seem like
90 // one contiguous input.
91 //
92 // Markup:
93 // <input value="input" class="mw-ui-input mw-ui-input-large" value="input">
94 // <textarea class="mw-ui-input mw-ui-input-large">textarea</textarea>
95 //
96 // Styleguide 1.3.
97 .mw-ui-input-large {
98 margin-top: 0;
99 margin-bottom: 0;
100 & + .mw-ui-input-large {
101 border-top-width: 0;
102 }
103 }
104
105 input.mw-ui-input-large {
106 font-size: 1.75em;
107 font-weight: bold;
108 line-height: 1.25em;
109 }