Automattic / _s

Hi. I'm a starter theme called _s, or underscores, if you like. I'm a theme meant for hacking so don't use me as a Parent Theme. Instead try turning me into the next, most awesome, WordPress theme out there. That's what I'm here for.
http://underscores.me/
GNU General Public License v2.0
10.93k stars 3.12k forks source link

Suggestion: Add the .toggled class to the body #1477

Open gsarig opened 3 years ago

gsarig commented 3 years ago

Hi,

Sometimes, a change that I need to do on the theme is to move the menu's .toggle class to the <body> instead of the nav element, renaming it to .menu-toggled for more precision. This gives more flexibility to add interactions outside the navigation's container, if necessary (e.g. hide parts of the site or apply some effect outside of the navigation).

I can't think of a disadvantage to that approach, but, of course, I might miss something. If there is indeed no drawback, perhaps it would be a better way to toggle the menu, as it would give more flexibility.