1 // Form elements and layouts
3 @import "mediawiki.mixins";
4 @import "mediawiki.ui/variables";
5 @import "mediawiki.ui/mixins";
7 // --------------------------------------------------------------------------
9 // --------------------------------------------------------------------------
11 // The FancyCaptcha image CAPTCHA used on WMF wikis drives the width of the
12 // 'VForm' design, the form can't be narrower than this.
13 @captchaContainerWidth: 290px;
14 @defaultFormWidth: @captchaContainerWidth;
22 // Style a compact vertical stacked form ("VForm") and the elements in divs
23 // within it. See button and inputs section on guidance of how and when to use them.
26 // <form class="mw-ui-vform">
27 // <div class="mw-ui-vform-field">This is a form example.</div>
28 // <div class="mw-ui-vform-field">
29 // <label>Username </label>
30 // <input class="mw-ui-input" value="input">
32 // <div class="mw-ui-vform-field">
33 // <button class="mw-ui-button mw-ui-constructive">Button in vform</button>
39 .box-sizing(border-box);
41 width: @defaultFormWidth;
43 // MW currently doesn't use the type attribute everywhere on inputs.
47 .box-sizing(border-box);
52 // Give dropdown lists the same spacing as input fields for consistency.
53 // Values taken from .agora-field-styling() in mixins/form.less
55 padding: 0.35em 0.5em 0.35em 0.5em;
56 vertical-align: middle;
61 .box-sizing(border-box);
62 .agora-label-styling();
68 // Override input styling just for checkboxes and radio inputs.
69 input[type="checkbox"],
72 .box-sizing(content-box);
77 // Styles for information boxes
79 // Regular HTMLForm uses .error class, some special pages like
80 // SpecialUserlogin (login and create account) use .errorbox.
83 // <form class="mw-ui-vform">
84 // <div class="errorbox">An error occurred</div>
85 // <div class="warningbox">A warning to be noted</div>
86 // <div class="successbox">Action successful!</div>
87 // <div class="error">A different kind of error</div>
88 // <div class="error">
89 // <ul><li>There are problems with some of your input.</li></ul>
91 // <div class="mw-ui-vform-field">
92 // <input type="text" value="input" class="mw-ui-input">
94 // <div class="mw-ui-vform-field">
96 // <option value="1">Option 1</option>
97 // <option value="2">Option 2</option>
99 // <span class="error">The value you specified is not a valid option.</span>
101 // <div class="mw-ui-vform-field">
102 // <button class="mw-ui-button">Button in vform</button>
111 .box-sizing(border-box);
115 word-wrap: break-word;
118 // Colours taken from those for .errorbox in skins/common/shared.css
121 border: 1px solid #fac5c5;
122 background-color: #fae3e3;
123 text-shadow: 0 1px #fae3e3;
126 // This specifies styling for individual field validation error messages.
127 // Show them below the fields to prevent line break glitches, and leave
128 // some space between the field and the error message box.
129 .mw-ui-vform-div .error, /* for backwards-compatibility, remove before 1.24 */
130 .mw-ui-vform-field .error {
137 // --------------------------------------------------------------------------
139 // --------------------------------------------------------------------------
141 // A wrapper for a single form field: the <input> / <select> / <button> element,
142 // help text, labels, associated error/warning/success messages, and so on.
143 // Elements with this class are generated by HTMLFormField in core MediaWiki.
145 // (We use a broad definition of 'field' here: a purely textual information
146 // block is also a "field".)
147 .mw-ui-vform-div, /* for backwards-compatibility, remove before 1.24 */
155 // Apply mw-ui-label to individual elements to style them.
156 // You generally don't need to use this class if <label> is within an Agora
157 // form container such as mw-ui-vform
159 .agora-label-styling(); // mixins/forms.less
162 // Nesting an input checkbox or radio button inside a label with this class
163 // improves alignment, e.g.
164 // <label class="mw-ui-checkbox-label">
165 // <input type="checkbox">The label text
167 .mw-ui-checkbox-label, .mw-ui-radio-label {
168 .agora-inline-label-styling();