Add a Sidebar Twig component#7729
Open
javiereguiluz wants to merge 2 commits into
Open
Conversation
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
This adds a new
<twig:ea:Sidebar>component to render the whole sidebar (logo, main menu, etc.) The component itself is not that interesting to end users because you'll rarely need it, but it makes other changes with impact for end users:The internals of the current sidebar were legacy (old Bootstrap-era CSS/JS from the first EasyAdmin versions). Now it's a set of composable Twig components, inspired by shadcn/ui's Sidebar but deliberately simpler:
ea:Sidebarcomponent family:Sidebar,Sidebar:Header,Sidebar:Content,Sidebar:Group,Sidebar:Item,Sidebar:SubmenuandSidebar:Footer(all anonymous components).sidebar_footerblock +ea:Sidebar:Footercomponent: contents always anchored to the bottom of the screen (menu items scroll underneath it), meant for important messages and notices.SubMenuItem::keepOpen()config method: renders a submenu always expanded, no matter the current URL, and makes it non-collapsible.menu.html.twignow chunks the flat menu item list into groups (sections become group labels) and renders everything through the new components;layout.html.twigkeeps all its overridable blocks (sidebar,header,main_menu_wrapper, …) working.grid-template-rowsanimation) instead of the old imperativestyle.maxHeightJavaScript.align items: first baseline).<button>(witharia-expanded) instead of a fake link.:focus-within); all animations respectprefers-reduced-motion.aria-current="page"and is scrolled into view on page load when it's outside the viewport.