Conflict with admin toolbar

Created on 16 December 2024, 4 months ago

Problem/Motivation

When using this module with admin toolbar enabled, it can cause some issues while loading the page, as critical css would not contain styles for elements of the toolbar and the page jumps while loading.

Steps to reproduce

1. Enable Critical CSS
2. Generate Critical CSS files
3. Enable Admin Toolbar module
4. Observe admin menu appears for a second while loading the page on frontend

Proposed resolution

I understand this module is not intended for admin theme and this approach is very reasonable. However it is still loading when page is viewed on frontend, with frontend theme, with admin toolbar enabled. In this situation, we are on frontend, route is not admin route, so module is loaded, but is causing some conflicts with admin toolbar.

I would suggest one of the options as a solution:
1. Next to all existing checks if module should be disabled, maybe we should have one more condition, checking if admin toolbar is loaded?
2. Or, maybe configuration should allow to exclude some roles. This way we can keep it enabled for logged in users, but website owner can decide to disable it for certain roles (because not every logged user = admin user)

🐛 Bug report
Status

Active

Version

2.0

Component

Code

Created by

🇵🇱Poland besek

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

Comments & Activities

Production build 0.71.5 2024