import type { Props } from '@astrojs/starlight/props';
import MobileMenuFooter from 'virtual:starlight/components/MobileMenuFooter';
import SidebarSublist from 'starlight-ion-theme/components/SidebarSublist.astro';
const { sidebar } = Astro.props;
<SidebarSublist sublist={sidebar as any} nestedCount={0} />
<div class="md:sl-hidden">
<MobileMenuFooter {...Astro.props} />
/* Hide markers for summaries (should be hidden by default, but showed again when changing stuff) */
summary::-webkit-details-marker {
display: none !important;
background-image: none !important;
-webkit-appearance: none !important;
/* Make sure links only have the width they need in the sidebar */
transition: all 0.1s ease;
/* Make sure mobile links fill the entire space, not just fit the content */
nav[aria-labelledby="starlight__on-this-page--mobile"] a {
This assumes that you will always have a top-level index file / file with the same name if there are subpaths,
so it moves the upmost nested child to the left
li.nested:first-of-type {
/* Hide all non-active nested children */
li.nested:not(:first-of-type):not(.active) {
If a child is active, show all adjacent children (by checking if the upmost child has an adjacent active li element)
li.nested:first-of-type:has(~ li.nested.active) ~ li.nested {
/* Show all adjacent children if an element is active */
li.nested.active ~ li.nested {
li.nested.active.has-icon ~ li.nested {
/* Make sure nesting works over multiple subpaths */
li.nested:first-of-type:has(~ li.nested li.nested.active) ~ li.nested {