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.
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.
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 thenav
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.