So what is the proper way to get a menu link to show active for the current page?

Thanks

Comments

Jeff Burnz’s picture

Depends on whats in your template, you can set an active trail class in your menu template, e.g....

        {%
          set item_classes = [
            'menu__item',
            item.in_active_trail ? 'is-active-trail',
          ]
        %}

...or by default Drupal adds the is-active class to active items (uses JS, so you must have JS enabled).