Github

Progress

The progress module gives you full control over the presentation of progress and loading on your pages. Apart from progress bars and color variants for them, spinner elements are provided to help communicate that something is loading.


Quick overview

Progress indicators are very common UI elements for almost any website and web app, as they help communicate vital information such as the fact that a process is being executed in the background, informing the user that they should wait for it to complete before proceeding. The progress module provides you with two essential tools to communicate this information: the <progress> HTML element, which is pre-styled and compatible with modern browsers to help you communicate information about the percentage of a task and the .spinner-donut class that allows you to create an animated spinner that communicates that something is loading currently and will continue doing so for an indefinite amount of time. Both elements come with their own color and size variants and are fully accessible.


Quick start

To customize the progress 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).


Progress bar

The progress module's styling of <progress> elements is highly customizable.


Variables
VariableTypeDescriptionSample value
$progress-back-colorColor Background color for <progress> elements#eeeeee
$progress-fore-colorColor Progress bar color for <progress> elements#01579b
$progress-heightHeight Height for <progress> elements14px
$progress-max-valueinteger Arithmetic max value for <progress> elements1000
$progress-border-styleBorder Border style for <progress> elements1px solid #bdbdbd
$progress-border-radiusBorder radius Border radius for <progress> elements1px
$progress-top-bottom-marginMargin (single value) Top and bottom margin for <progress> elements2px
$progress-left-right-marginMargin (single value) Left and right margin for <progress> elements8px
$progress-box-shadowBox shadow Box shadow for <progress> elements0 1px 3px rgba(0,0,0, 0.1)

Donut spinner

The progress module's donut spinner uses a custom class and a few variables for custmization.


Variables
VariableTypeDescriptionSample value
$spinner-donut-nameString Class name for donut spinner components'spinner-donut'
$spinner-donut-back-colorColor Background color for donut spinner components#e3f2fd
$spinner-donut-fore-colorColor Foreground color for donut spinner components#1565c0
$spinner-donut-border-thicknessBorder width Border width for donut spinner components4px
$spinner-donut-sizeSize (single value, px preferred) The size of donut spinner components (determines multiple values of the element)20px

Progress bar mixins

The progress module contains a couple of mixins for adding custom styles to <progress> elements (color and style variants), as well as a mixin for creating inline progress bars.


Mixin definitions
MixinDescription
make-progress-alt-color ($progress-alt-name, $progress-alt-fore-color, $progress-alt-back-color) Creates a new <progress> color variant using the specified values.
make-progress-alt-style ($progress-alt-name, $progress-alt-height,$progress-alt-top-bottom-margin,$progress-alt-left-right-margin, $progress-alt-border-style, $progress-alt-border-radius, $progress-alt-box-shadow) Creates a new <progress> style variant using the specified values.
make-progress-inline ($progress-inline-name, $progress-inline-width) Creates a new <progress> style variant using the specified values.

make-progress-alt-color
ParameterTypeDescriptionSample value
$progress-alt-nameString Class name for the <progress> color variant'secondary'
$progress-alt-fore-colorColor Foreground color for the <progress> color variant#e53935
$progress-alt-back-colorColor (Optional) Background color for the <progress> color variant#eeeeee

Sample usage

@include make-progress-alt-color ('secondary', #e53935, #eeeeee);

make-progress-alt-style
ParameterTypeDescriptionSample value
$progress-alt-nameString Class name for the <progress> style variant'nano'
$progress-alt-heightHeight Height for the <progress> style variant2px
$progress-alt-top-bottom-marginMargin (single value) (Optional) Top and bottom margin for the <progress> style variant1px
$progress-alt-left-right-marginMargin (single value) (Optional) Left and right margin for the <progress> elements1px
$progress-alt-border-styleBorder (Optional) Border style for the <progress> style variant1px solid #bdbdbd
$progress-alt-border-radiusBorder radius (Optional) Border radius for the <progress> style variant1px
$progress-alt-box-shadowBox shadow (Optional) Box shadow for the <progress> style variant0 1px 3px rgba(0,0,0, 0.1)

Sample usage

@include make-progress-alt-style ('nano', 2px, 1px, 1px, 1px solid #bdbdbd, 1px, 0 1px 3px rgba(0,0,0, 0.1));

make-progress-inline
ParameterTypeDescriptionSample value
$progress-inline-nameString Class name for the <progress> inline variant'inline'
$progress-inline-widthWidth (percentage preferred) Width of the <progress> inline variant60%

Sample usage

@include make-progress-inline ('inline', 60%);

Donut spinner mixins

The progress module contains a couple of mixins for adding custom styles to donut spinners (color and style variants).


Mixin definitions
MixinDescription
make-spinner-donut-alt-color ($spinner-donut-alt-name, $spinner-donut-alt-back-color, $spinner-donut-alt-fore-color) Creates a new donut spinner color variant using the specified values.
make-spinner-donut-alt-style ($spinner-donut-alt-name, $spinner-donut-alt-size, $spinner-donut-alt-border-thickness) Creates a new donut spinner style variant using the specified values.

make-spinner-donut-alt-color
ParameterTypeDescriptionSample value
$spinner-donut-alt-nameString Class name for the donut spinner color variant'secondary'
$spinner-donut-alt-back-colorColor Background color for the donut spinner color variant#ffebee
$spinner-donut-alt-fore-colorColor (Optional) Text color for the donut spinner color variant#c62828

Sample usage

@include make-spinner-donut-alt-color ('secondary', #ffebee, #c62828);

make-spinner-donut-alt-style
ParameterTypeDescriptionSample value
$spinner-donut-alt-nameString Class name for the donut spinner style variant'large'
$spinner-donut-alt-sizeSize (single value, px preferred) Size of the donut spinner style variant (determines multiple values of the element)32px
$spinner-donut-alt-border-thicknessBorder width (Optional) Border thickness for the donut spinner style variant6px

Sample usage

@include make-alert-alt-style ('large', 32px, 6px);

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.