-
Hi,
When I place a GenerateBlocks Container block inside a Header Element (hook) and set it to display: flex, the layout settings are saved correctly in the editor, but no corresponding GB CSS is output on the frontend.
The block attributes include “display”:”flex” etc and the HTML renders in the header correctly, but there is no generated .gb-container-xxxx { display:flex; } CSS in the page source.
DevTools shows the container as display: block.
If I manually add CSS targeting that class, it works fine.
The caching plugin is disabled.
It appears that GenerateBlocks conditional CSS generation is not detecting blocks rendered via Header Elements.
Is this expected behaviour?
Is there a way to ensure GB dynamic CSS is generated for blocks used inside Header Elements?Thanks,
Phil -
Alvind
Hi Phil,
That’s not the expected behavior. When I checked the generated CSS file, the properties for .
gb-container-603ec1c0are present, but thedisplay: flex;declaration doesn’t appear to be applied as expected: https://cln.sh/KWmX6xLchg1xzTXRhQ73Could you try going to GenerateBlocks > Settings in WP admin dashboard and clicking the Regenerate CSS Files button, then check again to see if that resolves it?
-
Thanks Alvind.
No, that did not help.
-
I added an admin user for you if you want to have a look.
-
It looks like this was caused by a unique class conflict. There were two elements with the class .gb-container-603ec1c0 on the page.
To resolve it, I duplicated the container wrapping the social icons (which had that class) and removed the original one. That appears to have fixed the issue.
Could you check on your end and confirm?
-
Thanks. That did the trick.
A div on the header widget has the same class name. -
Alvind
Glad to hear that!
- You must be logged in to reply to this topic.