Site logo

Archived topic

Mobile Menu - 100% width not working on menu toggle?

2 replies · Started by Greg on November 30, 2021

Viewing posts 1–3 of 3

Hi guys

Having a strange issue with the mobile menu on my site, for some reason the CSS class for the toggled state isn't loading:

.main-navigation.toggled .main-nav li {
    width: 100%;
    text-align: left;
}

It should look like:

Working mobile menu

But it's looking like:

Width not being set on mobile menu

I do have WP Rocket installed but have removed all the JS optimisation, and cleared the cache. The strange thing is the mobile menu was working perfectly before, with JS optimisation options in place - so not sure if something else might have caused it to break.

The only other thing I've changed was switching from Google Fonts to self-hosted variable fonts (.woff2).

Thanks
Greg

Sorry, now resolved!

Just incase anyone else finds this in the future - it was the 'Optimize CSS Delivery' and specifically the 'Remove Unused CSS' option in WP Rocket which was causing the issue. Once I switched that off and cleared the cache, all is good.

Thanks
Greg

Glad to hear you found the issue!!

This archived topic is closed to new replies.