Right sidebar layout has 2 menu areas with style cardmenu and style listgroup.
You can set in theme preferences if use the card look or not. Without it, menus are not bordered.
Listgroup is special style for listgroup bootstrap markup (there is different markup and look, not standard ul/li list).
There is the test if this style is used and the menu is the list in tablestyle(). If not, it's manually changed to cardmenu style. In new version, menu will have attribute if it's a list or not and this manual part will be replaced and done automatically.
To avoid rewriting of menu HTML markup (templating) CSS way was used (this was changed to have the same solution as core bootstrap4 theme.)