Github

Input Control

The input_control 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.

All examples showcased refer to the mini-default flavor, some class names and styles might differ based on the flavor you're using.


Quick overview

The presentation of forms, input fields, buttons and other interactive elements is always very important for any website or app. The input_control 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.


Quick start

To customize the input_control module, duplicate an existing flavor file (we suggest you use the mini-default.scss flavor file) and use this page's variable tables and mixins as a reference to change only the values you need. Remember to compile your flavor file (not the module's partial file) using a Sass preprocessor (we highly recommend using sass-autocompile if you are working with Atom).


Forms & input

The input_control module's forms and input fields can be easily customized to use different sizes and colors, as well as different class names for groupping.


Variables
VariableTypeDescriptionSample value
$form-back-colorColor Background color for <form> elements#eeeeee
$form-fore-colorColor Text color for <form> elements$fore-color
$form-border-styleBorder Border style for <form> elements1px solid #bdbdbd
$form-border-radiusBorder radius Border radius for <form> elements2px
$form-marginMargin Margin for <form> elements8px
$form-paddingPadding Padding for <form> elements12px
$form-box-shadowBox shadow Box shadow for <form> elements0 1px 3px rgba(0,0,0, 0.1)
$fieldset-back-colorColor Background color for <fieldset> elements$form-back-color
$fieldset-border-styleBorder Border style for <fieldset> elements1px solid #bdbdbd
$fieldset-border-radiusBorder radius Border radius for <fieldset> elements2px
$fieldset-marginMargin Margin for <fieldset> elements2px
$fieldset-paddingPadding Padding for <fieldset> elements8px
$legend-fore-colorColor Text color for <legend> elements$form-fore-color
$legend-font-sizeFont size Font size for <legend> elements0.925em
$legend-font-weightFont weight Font weight for <legend> elements700
$legend-paddingPadding Padding for <legend> elements2px 4px
$label-paddingPadding Padding for <label> elements4px
$input-back-colorColor Background color for <input> elements#fafafa
$input-fore-colorColor Text color for <input> elements$fore-color
$input-border-styleBorder Border style for <input> elements1px solid #bdbdbd
$input-border-radiusBorder radius Border radius for <input> elements1px
$input-marginMargin Margin for <input> elements2px
$input-paddingPadding Padding for <input> elements8px 12px
$input-focus-border-colorColor Border color for <input> elements (focused)#0288d1
$input-invalid-border-colorColor Border color for <input> elements (invalid)#d32f2f
$input-readonly-border-colorColor Border color for <input> elements (readonly)#bdbdbd
$input-readonly-back-colorColor Background color for <input> elements (readonly)#e0e0e0
$input-placeholder-fore-colorColor Text color for placeholder text of <input> elements#616161
$input-disabled-opacityOpacity Opacity of <input> elements (disabled)0.75
$input-group-nameString Class name for input groups'input-group'
$include-fluid-input-groupLogical Enables fluid input groups1true
$input-group-fluid-nameString Class name for fluid input groups1'fluid'
$input-group-mobile-breakpointBreakpoint Breakpoint for fluid input groups on mobile devices1767px
$hide-file-inputsLogical Hides all <input type="file"> elements, allowing access only via the use of labelstrue

Notes:

  1. The values of $input-group-fluid-name and $input-group-mobile-breakpoint will only be used if $include-fluid-input-group is set to true.

Checkboxes & radio buttons

The input_control module's checkbox and radio button elements are based on custom rules and depend on the use of <label> elements and input groups to be stylized and properly displayed.


Variables
VariableTypeDescriptionSample value
$checkbox-sizeSize (single value, px preferred) The size of checkbox/radio elements (determines multiple values of the elements)16px
$checkbox-back-colorColor Background color for checkbox/radio elements$input-back-color
$checkbox-fore-colorColor Text color for checkbox/radio elements$input-fore-color
$checkbox-border-thicknessBorder width Border width for checkbox/radio elements1px
$checkbox-border-colorColor Border color for checkbox/radio elements#bdbdbd
$checkbox-border-radiusBorder radius Border radius for checkbox/radio elements2px
$checkbox-focus-border-colorColor Border color for checkbox/radio elements (focused)#0288d1
$checkbox-bottom-spacingPosition bottom (px preferred) Position bottom spacing for checkbox/radio elements6px
$checkbox-disabled-opacityOpacity Opacity for checkbox/radio elements (disabled)0.75

Notes:

  1. It is highly recommended to stick to one unit type for the definitions of checkbox/radio elements (our suggestion is px).

Button & button groups

The input_control module's button elements are highly customizable, along with the button groups that can be used in combination with them.


Variables
VariableTypeDescriptionSample value
$button-back-colorColor Background color for button elements#bdbdbd
$button-fore-colorColor Text color for button elements$fore-color
$button-border-styleBorder Border style for button elements1px solid #9e9e9e
$button-border-radiusBorder radius Border radius for button elements2px
$button-marginMargin Margin for button elements8px
$button-paddingPadding Padding for button elements8px 12px
$button-box-shadowBox shadow Box shadow for button elements0 1px 3px rgba(0,0,0, 0.1)
$button-back-opacityOpacity Background opacity for button elements (default)0.65
$button-hover-back-opacityOpacity Background opacity for button elements (focused)0.8
$button-disabled-opacityOpacity Opacity for button elements (focused)0.65
$button-class-nameString Class name for button elements'button'
$button-group-nameString Class name for button groups'button-group'
$button-group-border-styleBorder Border style for button groups1px solid #9e9e9e
$button-group-marginMargin Margin for button groups8px
$button-group-box-shadowBox shadow Box shadow for button groups0 1px 3px rgba(0,0,0, 0.1)
$button-group-mobile-breakpointBreakpoint Breakpoint for button groups on mobile devices767px

Button mixins

The input_control module contains a couple of mixins for adding custom styles to button elements (color and style variants).


Mixin definitions
MixinDescription
make-button-alt-color ($button-alt-name, $button-alt-back-color, $button-alt-back-opacity, $button-alt-hover-back-opacity, $button-alt-fore-color) Creates a new button color variant using the specified values.
make-button-alt-style ($button-alt-name, $button-alt-border-style, $button-alt-border-radius, $button-alt-padding, $button-alt-margin) Creates a new button style variant using the specified values.

make-button-alt-color
ParameterTypeDescriptionSample value
$button-alt-nameString Class name for the button color variant'primary'
$button-alt-back-colorColor Background color for the button color variant#0277bd
$button-alt-back-opacityOpacity Background opacity for the button color variant (default)0.9
$button-alt-hover-back-opacityOpacity Background opacity for the button color variant (focused)1
$button-alt-fore-colorColor (Optional) Text color for the button color variant#fafafa

Sample usage

@include make-button-alt-color ('primary', #0277bd, 0.9, 1, #fafafa);

make-button-alt-style
ParameterTypeDescriptionSample value
$button-alt-nameString Class name for the button style variant'large'
$button-alt-border-styleBorder Border style for the button style variant2px solid #9e9e9e
$button-alt-border-radiusBorder radius Border radius for the button style variant4px
$button-alt-paddingPadding Padding for the button style variant12px 18px
$button-alt-marginMargin Margin for the button style variant10px

Sample usage

@include make-button-alt-style ('large', 2px solid #9e9e9e, 4px, 18px, 10px);

If you want to learn more about customizing mini.css, go back to the customization page or choose a module from the top menu to see its documentation.