1 // Form elements and layouts
3 @import 'mediawiki.mixins';
4 @import 'mediawiki.ui/variables';
6 /* stylelint-disable selector-class-pattern */
8 // --------------------------------------------------------------------------
10 // --------------------------------------------------------------------------
12 // The FancyCaptcha image CAPTCHA used on WMF wikis drives the width of the
13 // 'VForm' design, the form can't be narrower than this.
14 @captchaContainerWidth: 290px;
15 @defaultFormWidth: @captchaContainerWidth;
23 // Style a compact vertical stacked form ("VForm") and the elements in divs
24 // within it. See button and inputs section on guidance of how and when to use them.
27 // <form class="mw-ui-vform">
28 // <div class="mw-ui-vform-field">This is a form example.</div>
29 // <div class="mw-ui-vform-field">
30 // <label>Username </label>
31 // <input class="mw-ui-input" value="input">
33 // <div class="mw-ui-vform-field">
34 // <button class="mw-ui-button mw-ui-progressive">Button in vform</button>
40 .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;
56 vertical-align: middle;
62 .box-sizing( border-box );
73 // Override input styling just for checkboxes and radio inputs.
74 input[ type='radio' ] {
76 .box-sizing( content-box );
80 // Styles for information boxes
82 // Regular HTMLForm uses .error class, some special pages like
83 // SpecialUserlogin (login and create account) use .errorbox.
86 // <form class="mw-ui-vform">
87 // <div class="errorbox">
88 // <ul><li>An error occurred. There are problems with some of your input.</li></ul>
90 // <div class="warningbox">A warning to be noted</div>
91 // <div class="successbox">Action successful!</div>
92 // <div class="mw-ui-vform-field">
93 // <input type="text" value="input" class="mw-ui-input">
95 // <div class="mw-ui-vform-field">
97 // <option value="1">Option 1</option>
98 // <option value="2">Option 2</option>
100 // <span class="error">The value you specified is not a valid option.</span>
102 // <div class="mw-ui-vform-field">
103 // <button class="mw-ui-button">Button in vform</button>
111 .box-sizing( border-box );
115 word-wrap: break-word;
118 // This specifies styling for individual field validation error messages.
119 // Show them below the fields to prevent line break glitches, and leave
120 // some space between the field and the error message box.
129 // --------------------------------------------------------------------------
131 // --------------------------------------------------------------------------
133 // A wrapper for a single form field: the <input> / <select> / <button> element,
134 // help text, labels, associated error/warning/success messages, and so on.
135 // Elements with this class are generated by HTMLFormField in core MediaWiki.
137 // (We use a broad definition of 'field' here: a purely textual information
138 // block is also a "field".)
146 // Apply mw-ui-label to individual elements to style them.
147 // You generally don't need to use this class if <label> is within an Agora
148 // form container such as mw-ui-vform