Problem/Motivation

If I install the module in Drupal 11 and use it with https://www.drupal.org/project/bootstrap5, the settings are shown briefly, and they then slide down and are hidden, every time a link is clicked and a new page is shown, or just reloading the page. Also, the icon seem to blink on reload.

This does not happen for example with the Olivero theme, or even in some Drupal installations with Bootstrap5.

More problematic, the Accessibility Menu style is lost following a link or after reload, so if you use for example contrast, the page can flash from white background to light blue overlay, so the whole page blinks.

This seems to happen in all themes.

From GitLab MR summary:

The closed panel is hidden only by translateY(100%) with the transform transition always on, so a panel styled before its stylesheet applied slid from on-screen to hidden on every page load.

  • Keep panel transitions off until window.load (am-ready class).
  • Hide the closed desktop panel with visibility: hidden, matching the mobile styles.

To sum up:

  • Under some conditions: The settings are shown on refresh, and slide down
  • Under some conditions: The icon blinks
  • All cases: The original theme can be shown in a flash, and then replaced (easiest to see with Contrast)

Should the last item on the list, about the original style getting shown first, be split off into a separate issue?

Steps to reproduce

It seems like under some circumstances, with some themes, the Accessibility Menu style is not loaded first:

  1. Install the module
  2. Use it to set for example contrast
  3. Click some links
  4. The page and icon blinks, and the settings are briefly shown and then slide down

Proposed resolution

Make sure that Accessibility Menu style and script are loaded first, so the page does no blink, and are briefly shown.

Remaining tasks

User interface changes

API changes

Data model changes

Command icon Show commands

Start within a Git clone of the project using the version control instructions.

Or, if you do not have SSH keys set up on git.drupalcode.org:

Comments

ressa created an issue. See original summary.

stingo-36 made their first commit to this issue’s fork.

ressa’s picture

Issue summary: View changes
Status: Active » Needs work

Thank you @stingo-36! Your MR fixes the problem, and the settings are not shown briefly, but it also allowed me to notice another bug. The icon briefly blinks on reload, or when clicking a link, and even more problematic, the original styling is shown, when you reload the page or click a link.

It would be nice if we could find reproducible steps to recreate it, since it seems to only happen sometimes, under certain conditions ... Like I wrote, it does not happen for example with the Olivero theme, but also even not for some Drupal installations with Bootstrap5: The "Sliding settings on reload"-problem may not happen.

Perhaps you have discovered instances where it happens, and where it does not, and why? If so, feel free to share it here.

ressa’s picture

Title: Settings are shown briefly in Bootstrap5 when changing page » Original style and settings are shown briefly in some themes
Issue summary: View changes

Like I commented, there is a bigger problem: The style is also lost briefly on reload or a link clicked, and I have updated the Issue Summary.

Is the core problem the order of items loaded? If it is, then rather than updating the style and script, wouldn't it be better to make sure that Accessibility Menu is always loaded as the first resource (or last?), whatever results in the optimal performance, with no blinking of style or icon?

ressa’s picture

Issue summary: View changes

I just noticed that the showing of the original theme happens in all themes, so updating the Issue Summary.