Add active class to menu item when viewing items, collections

Is there a built in way to add the active class to, for example, the Browse Items menu item when viewing an item page?

This should be repeatable for other sections, so the Browse Collections menu item would be active when viewing a collection.