@Litalino et al, finally I had time to investigate it, so now I can answer my own question on how dropdowns can be added to Litalino's top bar extension. Given a menu like:
<ul>
<li class="TopBar-item">
<a href="https://your-link-1/" title="1st menu item">1st menu item</a>
</li>
<li class="TopBar-item">
<a href="https://your-link-2/" title="2nd menu item">2nd menu item</a>
</li>
</ul>
dropdowns can be added by placing the following content inside each the <li> tag for each menu option that must become a dropdown:
- a <div> tag encapsulating the whole <li> item. It must include the classes ButtonGroup, Dropdown and dropdown (yes, Dropdown and dropdown are different classes).
- the a link that typically contains the menu item name, must include the data-toggle"dropdown" (and, preferably, aria-expanded="false"), and replace its href to "#". You may want to add <i class="fas fa-caret-down"></i> to show a caret that indicates that this item can be expanded.
- a <ul> tag that contains the classes Dropdown-menu and dropdown-menu as a placeholder for each menu item in the dropdown. Each menu item inside the dropdown must be constructed with <li><a> tags as usual. You may want to add also the Dropdown-menu--right class if you want the dropdown menu to be aligned to the right.
In other words, for the menu in my initial exemple, the code below would add two dropdowns with two menu items each as follows:
<ul>
<li class="TopBar-item">
<a href="https://your-link-1/" title="1st menu item">1st menu item</a>
</li>
<li class="TopBar-item">
<a href="https://your-link-2/" title="2nd menu item">2nd menu item</a>
</li>
<li class="TopBar-item">
<div class="ButtonGroup Dropdown dropdown">
<a hfer="#" data-toggle="dropdown" aria-expanded="false">1st dropdown <i class="fas fa-caret-down"></i></a>
<ul class="Dropdown-menu dropdown-menu Dropdown-menu--right">
<li>
<a href="https://your-link-3/" title="1st item in 1st dropdown">1st item in 1st dropdown</a>
</li>
<li>
<a href="https://your-link-4/" title="2nd item in 1st dropdown">2nd item in 1st dropdown</a>
</li>
</ul>
</div>
</li>
<li class="TopBar-item">
<div class="ButtonGroup Dropdown dropdown">
<a hfer="#" data-toggle="dropdown" aria-expanded="false">2nd dropdown <i class="fas fa-caret-down"></i></a>
<ul class="Dropdown-menu dropdown-menu Dropdown-menu--right">
<li>
<a href="https://your-link-5/" title="1st item in 2nd dropdown">1st item in 2nd dropdown</a>
</li>
<li>
<a href="https://your-link-6/" title="2nd item in 2nd dropdown">2nd item in 2nd dropdown</a>
</li>
</ul>
</div>
</li>
</ul>