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">An error occurred</div>
88 // <div class="warningbox">A warning to be noted</div>
89 // <div class="successbox">Action successful!</div>
90 // <div class="error">A different kind of error</div>
91 // <div class="error">
92 // <ul><li>There are problems with some of your input.</li></ul>
94 // <div class="mw-ui-vform-field">
95 // <input type="text" value="input" class="mw-ui-input">
97 // <div class="mw-ui-vform-field">
99 // <option value="1">Option 1</option>
100 // <option value="2">Option 2</option>
102 // <span class="error">The value you specified is not a valid option.</span>
104 // <div class="mw-ui-vform-field">
105 // <button class="mw-ui-button">Button in vform</button>
115 .box-sizing( border-box );
119 word-wrap: break-word;
122 // Colours taken from those for .errorbox in shared.css
124 color: @colorErrorText;
125 border: 1px solid #fac5c5;
126 background-color: #fae3e3;
129 // Colours taken from those for .warningbox in shared.css
131 color: @colorWarningText;
132 border: 1px solid #fde29b;
133 background-color: #fdf1d1;
136 // This specifies styling for individual field validation error messages.
137 // Show them below the fields to prevent line break glitches, and leave
138 // some space between the field and the error message box.
148 // --------------------------------------------------------------------------
150 // --------------------------------------------------------------------------
152 // A wrapper for a single form field: the <input> / <select> / <button> element,
153 // help text, labels, associated error/warning/success messages, and so on.
154 // Elements with this class are generated by HTMLFormField in core MediaWiki.
156 // (We use a broad definition of 'field' here: a purely textual information
157 // block is also a "field".)
165 // Apply mw-ui-label to individual elements to style them.
166 // You generally don't need to use this class if <label> is within an Agora
167 // form container such as mw-ui-vform