Closed pd95 closed 6 days ago
This was something I had hoped to get into the initial release, but it just didn't make the cut because I ran out of time, so I have no problem merging it in now – I don't think it will cause any problems. You've also solved it exactly the right way given the current code structure, so I think we should get this merged in. Are you happy to move forward?
Thank you, @PetrPrazak and @pd95! 🙌 All good to merge now?
👍🏻 from my side.
This Pull Request implements highlighting the currently active page in the
NavigationBar
as illustrated with the image below. It supportsLink
s andDropDown
s. The implementation relies on Bootstraps "active" CSS class for "nav-link" elements.Current issues:
According to the documentation (see link above) one should add also "aria-current: true" attribute to the currently selected element. To be implementedcurrentRenderingPath
toPublishingContext
and set it accordingly in somerender
methods to allow checking for it in theNavigationBar
implementation so we know which link should be marked as "active". I think this would be something to be added to an@Environment
.