my website menu has multiple levels. On the mobile version, I am working with Accordion elements to expand/collapse them. I want to realize my menu without JS and with CSS only. Therefore, I use checkboxes to trigger the accordion elements to expand/collapse.
For the mobile menu, I created a custom twig template. I added the complete Code below.
Since the checkboxes in my menu are invisible, I work with label elements. Therefore, my checkboxes and the labels have IDs to assign them correctly.