<ahref="core.html#lists"class="sublink-1">Lists</a><ahref="core.html#images-captions"class="sublink-1">Image responsiveness & captions</a>
<br/><ahref="grid.html#grid-title">Grid</a>
<ahref="grid.html#basic-layout"class="sublink-1">Basic layout</a><ahref="grid.html#screen-specific-layout"class="sublink-1">Screen specific layouts</a>
<ahref="input_control.html#forms-input"class="sublink-1">Forms & input</a><ahref="input_control.html#checkbox-radio"class="sublink-1">Checkboxes & radio buttons</a>
<ahref="input_control.html#buttons"class="sublink-1">Buttons & button groups</a><ahref="input_control.html#file-upload"class="sublink-1">File upload buttons</a>
<br/><ahref="table.html#table-title">Table</a>
<ahref="table.html#syntax-responsiveness"class="sublink-1">Basic syntax & responsiveness</a>
<ahref="table.html#horizontal-tables"class="sublink-1">Horizontal tables</a><ahref="table.html#variants-matrices"class="sublink-1">Table variants & matrices</a>
<br/><ahref="card.html#card-title">Card</a>
<ahref="card.html#basic-syntax"class="sublink-1">Basic syntax</a><ahref="card.html#sections-media"class="sublink-1">Sections & media</a>
<ahref="card.html#sizing-fluidity"class="sublink-1">Card sizing & fluidity</a>
<ahref="progress.html#basic-progress-bar"class="sublink-1">Basic progress bar</a><ahref="progress.html#progress-variants"class="sublink-1">Progress bar variants</a>
<ahref="utility.html#visibility-helpers"class="sublink-1">Visibility helpers</a><ahref="utility.html#borders-shadows"class="sublink-1">Generic borders & shadows</a>
<ahref="utility.html#responsive-sizing"class="sublink-1">Responsive sizing & spacing classes</a>
<p>The <strong>input_control</strong> module contains rules that affect forms, input elements, buttons, checkboxes and radio buttons. All of these elements' styles are predefined, allowing you to create modern, responsive forms quickly. Layout alternatives are also provided if you want your forms to look a certain way.</p>
<p><small>All examples showcased refer to the mini-default flavor, some class names and styles might differ based on the flavor you're using.</small></p><br/>
<p>The presentation of forms, input fields, buttons and other interactive elements is always very important for any website or app. The <strong>input_control</strong> module provides you with much needed styling improvements for all of these elements, while keeping everything simple to use and understand, as well as combine with the other modules. Forms and input elements have a clean, modern design, while some elements like checkoxes and radio buttons get a much needed facelift. Buttons have also been stylized to look the same in all browsers, while keeping their design clean and allowing for a few color and size variants. Grouping inputs and labels or buttons is also part of this module and, as always, responsiveness is an important feature. Finally, all of the components are accessible, with a few minor caveats, that are discussed in their respective section in this page.</p><br>
</div>
<divclass="section">
<h2>Quick start</h2>
<p>To use the <strong>input_control</strong> module, simply include the link to the flavor you are using and start writing your HTML page as usual. One suggestion we will make is to add the following line inside your HTML page's <code><head></code> to utilize the viewport meta tag:</p><br>
<p>Forms are structured the same way you would structure a normal form in HTML5. Simply create a root <code><form></code> element and add your <code><input></code> elements inside. Link them to <code><label></code> elements for ease of acces and you are pretty much set. We highly recommend using the <code><fieldset></code> and <code><legend></code> elements to annotate your forms as well, but you can skip them if you wish.</p>
<p>Forms are inline by default. Use the <code>.input-group</code> class on a <code><div></code> wrapping inside it an <code><input></code> and <code><label></code> pair to make sure they always display together in one line. You can make your <code>.input-group</code>s respond to viewport changes, by adding the <code>.fluid</code> class to them. Finally, if you want to create aligned forms with a preset layout, you can utilize the <ahref="grid.html"><strong>grid</strong></a> module's rows and columns.</p>
<li>Using the <code><fieldset></code> and <code><legend></code> elements is highly recommended for a better presentational effect. Using these elements is a matter of personal preference, however try to keep your forms consistent (i.e. either use them in all forms or no forms as to not confuse users).</li>
<li>Some <code><input></code> elements, such as date & time, color and range types, are not supported and, as a result, do not have a default style defined for them. You can define said styles manually if you need to use them in your website or app.</li>
<li>Checkboxes and radio buttons are not stylized the same way as most of the other elements, nor do they follow the exact same stucture for layout. Please refer to the next section for information on how to use those.</li>
<li>Try not to combine the <strong>grid</strong> module's classes with <code>.fluid</code><code>.input-group</code>s, as this might cause certain styles to overlap and not display exactly like you want them to.</li>
<pclass="do"><markclass="tertiary">Do:</mark> You can use <code>.row</code> and <code>.col-<spanclass="fore-primary">SCR_SZ</span></code> or <code>.col-<spanclass="fore-primary">SCR_SZ</span>-<spanclass="fore-secondary">COL_WD</span></code> (replacing <code><spanclass="fore-primary">SCR_SZ</span></code> with one of the available screen size names (<code><spanclass="fore-tertiary">sm</span></code> for smaller screens, <code><spanclass="fore-tertiary">md</span></code> for medium-sized screens or <code><spanclass="fore-tertiary">lg</span></code> for larger screens and <code><spanclass="fore-secondary">COL_WD</span></code> with a number from <code>1</code> to <code>12</code> specifying the width of the column) to set specific layouts for your aligned forms. You can also use the same column classes to make them responsive for different screen sizes.</p>
<pclass="do"><markclass="tertiary">Do:</mark> Apart from using <code>.row</code> and <code>.col-<spanclass="fore-primary">SCR_SZ</span></code> or <code>.col-<spanclass="fore-primary">SCR_SZ</span>-<spanclass="fore-secondary">COL_WD</span></code> for responsiveness, you can also use other classes from the <strong>grid</strong> module such as the offset classes to make your form layouts more interesting.</p>
<pclass="do"><markclass="tertiary">Do:</mark> When creating aligned forms using the <strong>grid</strong> module's classes, labels might be off-center vertically compared to their inline counterparts. Use a simple styling for their parent <code>.row</code> element, if you want to adjust their vertical alignment.</p>
<pclass="dont"><markclass="secondary">Don't:</mark> Avoid using the <code>.input-group</code> class when creating aligned forms. This might cause unexpected behavior.</p>
<p>Checkboxes and radio buttons come pre-styled, using the <ahref="https://css-tricks.com/the-checkbox-hack/">checkbox hack</a>, while remaining fully accessible. To create a checkbox or radio button, start using a <code><div></code> that implements the <code>.input-group</code> class, and then add an <code><input></code> of the proper <code><spanclass="secondary">type</span></code> inside it (<code><spanclass="fore-primary">"checkbox"</span></code> or <code><spanclass="fore-primary">"radio"</span></code>), followed immediately by a <code><label></code> linking to it. Remember to add <code><spanclass="fore-secondary">tabindex</span>=<spanclass="fore-primary">"0"</span></code> to your <code><input></code>, so that it will register properly for screen readers.</p>
<li>Checkboxes and radio buttons are fully accessible. However, if not provided with a label, they are not visible to users, but only to screen readers.</li>
<pclass="do"><markclass="tertiary">Do:</mark> You can add multiple <code>radio</code> buttons inside one <code>.input-group</code>, as long as they follow the syntax shown above. In fact, we strongly recommend grouping controls that are relevant to each other in this manner.</p>
<pclass="dont"><markclass="secondary">Don't:</mark> Always use an <code>.input-group</code> for your checkboxes and radio buttons. Not doing so will cause the checkbox or radio button to not display properly.</p>
<pclass="dont"><markclass="secondary">Don't:</mark> Remember to add <code><spanclass="fore-secondary">tabindex</span>=<spanclass="fore-primary">"0"</span></code> to all your checkboxes and radio buttons to make them accessible.</p>
<pclass="dont"><markclass="secondary">Don't:</mark> The structure of checkboxes and radio buttons is very strict, meaning that the <code><label></code> should always be after the <code><input></code> and never before, otherwise the checkbox or radio button will not display properly.</p>
<pclass="dont"><markclass="secondary">Don't:</mark> When using multiple radio buttons inside an <code>.input-group</code>, remember to use the usual structure of the radio button component for each radio button (i.e. the <code><input></code> and <code><label></code>). Not doing so will cause the radio buttons to not display properly.</p>
<pclass="dont"><markclass="secondary">Don't:</mark> Never leave a checkbox or radio button without a <code><label></code>. The <code><label></code> is essential to properly display the checkbox or radio button.</p>
<p>All button types have been stylized by default, while maintaining accessiblity. Simply add any <code><button></code> or an <code><input></code> with a button <code><spanclass="secondary">type</span></code> (i.e. <code><spanclass="fore-primary">"button"</span></code>, <code><spanclass="fore-primary">"submit"</span></code> or <code><spanclass="fore-primary">"reset"</span></code>) and they will be styled accordingly. You can also use the <code>.button</code> class or the <code><spanclass="fore-secondary">role</span>=<spanclass="fore-primary">"<ahref="https://developer.mozilla.org/en-US/docs/Web/Accessibility/ARIA/ARIA_Techniques/Using_the_button_role">button</a>"</span></code> attribute for links, labels and other elements of your choice to make them look like buttons.</p>
<p>Color variants are available in the form of the <code>.primary</code>, <code>.secondary</code>, <code>.tertiary</code> and <code>.inverse</code> classes. Size variants are available as well in the form of <code>.small</code> and <code>.large</code> classes.</p>
<p>Finally, you can create responsive groups of buttons by wrapping them inside a <code><div></code> with the <code>.button-group</code> class.</p>
<li>If you want more color or size variants for your buttons, check out the <ahref="customization.html">customization</a> page.</li>
<li>The <code>.button-group</code> component is compatible with modern browsers, but might not display properly in older browsers.</li>
<li><code>.button-group</code>s will display as a horizontal container with all their buttons in one row on medium-sized and larger displays, however they will collapse into a column view for smaller displays.</li>
<pclass="dont"><markclass="secondary">Don't:</mark> Avoid mixing two or more button color or size variants, as these combinations might result in unexpected behavior.</p>
<pclass="do"><markclass="tertiary">Do:</mark> You can use button color variants inside the same <code>.button-group</code>. You can also use any component styled like a button inside a <code>.button-group</code>.</p>
<pclass="dont"><markclass="secondary">Don't:</mark> Avoid using button size variants inside a <code>.button-group</code>, as this might result in unexpected behavior.</p>
<p>File upload buttons are commonly a sore spot in CSS frameworks. We try to remedy this problem by hiding the <code><input <spanclass="fore-secondary">type</span>=<spanclass="fore-primary">"file"</span>></code>, while maintaining accessibility and using a linked <code><label></code> of the <code>.button</code> class to display it in a modern way.</p>
<li>The icon displayed in the example above is not part of the button styling.</li>
<li>File upload buttons do not change their text to the name of the file after the user has selected a file to upload. You can, however, add this functionality using a few lines of Javascript.</li>
<li>File upload buttons cannot be focused (i.e. have a <code>:focus</code> state) using the keyboard and this applies to linked labels, too. You can use Javascript to add this functionality, if you wish.</li>
<pclass="do"><markclass="tertiary">Do:</mark> You can use an <code>.input-group</code> to wrap the file upload <code><input></code> and its linked <code><label></code>, if you wish.</p>
<p>If you want to learn more about <strong>mini.css</strong>'s modules, go back to the <ahref="modules.html">modules page</a> and choose another module to see its documentation.</p>
<footer><strong>mini.css</strong> was designed and built with <iclass="fa fa-heart-o"aria-hidden="true"></i> by <ahref="https://github.com/Chalarangelo">@Chalarangelo</a>. It is licensed under the <ahref="https://github.com/Chalarangelo/mini.css/blob/master/LICENSE">MIT License</a>. You can view the project's source code on <ahref="https://github.com/Chalarangelo/mini.css">Github</a>.</footer>