After upgrading to Ultimenu 3.x, an additional class ultimenu__link was added in UltimenuTree.php, which affected the existing styles of the site.

Created on 20 December 2024, about 1 month ago

Problem/Motivation

After upgrading to Ultimenu 3.x, an additional class ultimenu__link was added in UltimenuTree.php, which affected the existing styles of the site.

Steps to reproduce

Upgrade ultimenu from 2.x to 3.x
check the menu tree link class. add an additional class 'ultimenu__link'

Proposed resolution

remove the class

Remaining tasks

User interface changes

API changes

Data model changes

🐛 Bug report
Status

Active

Version

3.0

Component

Code

Created by

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

Comments & Activities

  • Issue created by @connbi
  • 🇮🇩Indonesia gausarts

    Thank you.

    You might be right for particular usages, and I understand such a problem with this change.

    However as I said in the docs, I don't worry much about CSS thingies :)

    Hence in your case the solution is you should use more specific CSS rules with direct descendants to not leak to submenu links.

    See examples here https://git.drupalcode.org/project/ultimenu/-/blob/3.0.x/css/components/...

    /* Without direct decendants > to be inherited as needed. */
    .ultimenu li .ultimenu__link {
      color: var(--ultilink-normal);
    }
    
    /* With direct decendants > to avoid submenus from inheritance. */
    .ultimenu > li > .ultimenu__link {
      background-color: var(--ultilink-bg-normal);
    }
    

    The ultimenu__link was normally available for the first level menu, indeed, since we have no new features till 3.x.

    Reasons for the new ultimenu__link in submenus as newly introduced in 3.x:

    • To support <nolink> with consistent styling since it has no A tag.
    • To support collapsible menus relevant to JS.
    • To minimize confusing anonymous A tag without a class causing non-efficient and too many decendant usages since flyout may also have A tags.

    Be informed, new branches allow breaking changes in designs and features so this change does not classify a bug.

    The way you use CSS rules matter here.

  • 🇵🇰Pakistan danyal zeb

    i have update ultimenu from 2.12 to 3.0.5 and now on mobile and tablet the menu comes expanded by default also the hemburger icon is not working the button icon is also taking a display none class by default on mobile and tablet

  • 🇮🇩Indonesia gausarts

    See project home First things first, or here: https://www.drupal.org/node/3447576

    In short, you must re-save both Ultimenu and it's block form, and tick the new options as required.

  • 🇵🇰Pakistan danyal zeb

    i have changed the classes but still it has a lot of issues when i open menu in mob and inspect it it disappears and in my case menu is fixed so when i scroll down and click on hamburger menu everything becomes dark

  • 🇮🇩Indonesia gausarts

    Try switching to Olive for a mo. It has a fixed header like yours.

    See an example how to deal with fixed header:
    https://git.drupalcode.org/project/ultimenu/-/blob/3.0.x/css/components/...

    You may want to copy some rules if you have issues with CSS.

    If you have issues with upgrade, I recommend you re-reading the CR linked previously. I updated with upgrade steps yesterday. Or stick to working version 2.x till you have time to update it, or use 3.x for new sites only.

Production build 0.71.5 2024