matcornic / hugo-theme-learn

Porting Grav Learn theme to Hugo
https://learn.netlify.com/en/
MIT License
1.61k stars 1.28k forks source link

Always show menus expanded? #414

Open MostHated opened 4 years ago

MostHated commented 4 years ago

Hello
I have been trying to figure out if there is a way to always show the entire menu as expanded, not just when you are under a particular top-level, but even at the main root _index.md. Is this possible currently?

Thanks, -MH

macropin commented 3 years ago

I've got a similar issue. I'm trying to prevent the second level menus from fully expanding.

macropin commented 3 years ago

@MostHated add the following to your custom theme and this should expand all the menus:

#sidebar ul.topics ul {
  display: block;
}

For my requirements the following css will expand only the child menu one level:

/*
#sidebar ul.topics > li.active ul {
    display: none;
}
#sidebar ul.topics > li.active > ul {
    display: block;
}

Both the above were adapted from answers given in #88