Progress bars

Styling for the native <progress> element. Add .progress.

Give it a value for a known amount; omit value for an indeterminate, animated bar. The text content is the fallback / accessible name.

70% Loading…

Colours

A palette-family class recolours the fill: .primary, .secondary, .success, .warning, .error, or .soft. New families in $colors get a variant automatically.

45% Loading… 20%

Motion

The indeterminate sweep respects prefers-reduced-motion — it slows to a crawl rather than stopping, since an indeterminate bar still has to signal activity. In Windows High Contrast mode it becomes a pulsing Highlight bar.

Overriding

  • One bar / a scoped rule — set the --jf-progress-bar-* custom properties (tabled below) on .progress or a scoped selector.
  • Shape — the Sass variables below.

Variables

Sass variables

Progress Sass variables
NameDefaultNotes
$generate-progressbartrueEmit the .progress CSS at all.
$progressbar-heightget-size(1) (16px)Bar thickness.
$progressbar-border-radiustoken(radius-md)Track corner radius.
$progressbar-value-border-radiustoken(radius-none) (0)Corner radius of the filled portion. Square by default so a part-full bar meets the track edge cleanly.
$progressbar-indeterminate-duration10sOne sweep of the indeterminate animation. Slowed, not stopped, under prefers-reduced-motion — an indeterminate bar still has to signal activity.

Custom properties

Progress custom properties
NameDefaultNotes
--jf-progress-bar-colorneutral / 500The filled portion.
--jf-progress-bar-color-unknownneutral / mutedThe indeterminate sweep.
--jf-progress-bar-bg-colorneutral / subtleThe track behind the fill.