Add a "menu-level" class to menu items

Created on 28 October 2016, over 7 years ago
Updated 28 January 2023, over 1 year ago

Looking at `menu.html.twig`, it seems trivial to add a `menu-level--X` class to menu items. I have done this in my own theme by copying the Classy theme template and adding a single line. This is useful if you want to theme different menu levels differently. If this would be accepted, I can provide a patch.

Thanks,
Ricky

✨ Feature request
Status

Active

Version

1.0

Component

Code

Created by

πŸ‡ΊπŸ‡ΈUnited States pukku

Live updates comments and jobs are added and updated live.
Sign in to follow issues

Comments & Activities

Not all content is available!

It's likely this issue predates Contrib.social: some issue and comment data are missing.

  • πŸ‡ΊπŸ‡ΈUnited States smustgrave

    Since classy was removed in D10 going to move this over.

    Checked olivero on this one and it appears it adds classes example "primary-nav__menu--level-1"

Production build 0.69.0 2024