My darkmode toggle interacts with nav item

Probably not a bug, but just a minor issue for me, and for sure a beginners question:
I am using the dark mode switch frontend toggle (explained by cwicly here: https://www.youtube.com/watch?v=ZmGkrGnAi8o&t=504s)

It is working fine, with one minor issue:
Within the nav bar the first item (which does show a custom submenu on hoover) adopts the smooth timing of the switch of the dark to light mode svg icon. Why, is unclear to me, the other menu items do not show this unwanted behavior. That menu item is tagged as li. Changing that to e.g. a or div helps, but then my custom menu is not displaying on hover.