- Issue created by @besek
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.
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
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)
Active
2.0
Code