The code above only manipulates the style by indenting the side menu based on whether the “active” condition is met, determining whether to show or hide other menus. You can try it directly; it might still work.
As a consideration, you may want to try this method with your own custom menu. This approach offers more control: