A user modified their Craft theme menu drawer to 70% width but lost visual separation from the underlying content. They requested a blur and dark tint effect on the background when the menu opens.
Solutions provided:
CSS approach for mobile drawer menus: Add code to Theme Settings → Custom CSS targeting body[class*=overflow-hidden] main with blur and brightness filters
JavaScript solution: Insert code in theme.liquid file (above </body> tag) that adds/removes a CSS class when the menu opens/closes
Desktop hoverable menu fix: Use :has() selector targeting body:has(header [open]) to apply blur effects to main and footer elements
Implementation workaround:
When Custom CSS won’t save the code, add a “Custom liquid” section in the Footer section group (via Customizer, not code editor) and wrap the CSS in <style> tags.
The original poster confirmed one solution worked. A follow-up user with a hoverable menu encountered saving issues, which were addressed through the Custom liquid workaround method.
Summarized with AI on October 28.
AI used: claude-sonnet-4-5-20250929.
Defaultly the menu drawer of my craft theme was of full width but I changed it to only 70%.
Now when the menu is opened there is no visible seperation between the menu and the underlying content which is not suitable for the website. So I need the underlying content to be blurry and a slightly black tinted when the menu is open.
Thank you for your reply. I’m glad to hear that the solution worked well for you. If you require any more help, please don’t hesitate to reach out. If you find this information useful, a Like would be greatly appreciated.