Progress bar CSS library (core/drupal.progress) is not always applied

Created on 7 August 2025, about 1 month ago

Problem/Motivation

I am adding a progress bar to a custom multistep form via '#theme' => 'progress_bar',, and I discovered that the core/drupal.progress CSS library was not being added under certain conditions. This results in an unstyled progress bar.

In my case, it worked when I was logged in, but not when I was logged out. Here are screenshots using the Claro theme:

Logged in:

Logged out:

I investigated and found that the core/drupal.progress is only added as a dependency to the core/drupal.ajax and core/drupal.batch libraries, but it is not being added to progress_bar elements directly. This means it only gets applied when the batch or ajax libraries are added to the page. In my case, neither of those were added when I was logged out, which revealed this bug.

Steps to reproduce

Create a page that uses '#theme' => 'progress_bar', but does not use core/drupal.ajax or core/drupal.batch libraries. Observe that the progress bar CSS styles are not added.

Proposed resolution

The core/drupal.progress library should be added to all `progress_bar` elements.

I think this would also allow us to remove it as an explicit dependency from the core/drupal.ajax and core/drupal.batch libraries.

Remaining tasks

TBD

User interface changes

Fixes progress bar CSS outside of the context of batch/ajax.

Introduced terminology

None.

API changes

None.

Data model changes

None.

Release notes snippet

TBD

πŸ› Bug report
Status

Active

Version

11.0 πŸ”₯

Component

CSS

Created by

πŸ‡ΊπŸ‡ΈUnited States m.stenta

Live updates comments and jobs are added and updated live.
Sign in to follow issues

Comments & Activities

Production build 0.71.5 2024