kitconcept / volto-light-theme

https://light-theme.kitconcept.io
11 stars 8 forks source link

Customizable mobile navigation #393

Closed lenadax closed 2 months ago

lenadax commented 3 months ago

Description

This pull request enhances the Mobile Navigation component to be more customizable. Key changes:

Motivation/Context

These changes are intended to make the Mobile Navigation component more adaptable to different use cases and easier to extend or override.

Please review the changes and let me know if there are any improvements or adjustments needed.

sneridagh commented 3 months ago

@lenadax Do this PR modify the existing HTML structure of the mobile menu or have any change in the classnames, etc? We consider these changes a breaking change, and if so, we should issue it. Basically we follow the same policy as in Volto for definition of breaking.

I will have a closer look now.

lenadax commented 3 months ago

@lenadax Do this PR modify the existing HTML structure of the mobile menu or have any change in the classnames, etc? We consider these changes a breaking change, and if so, we should issue it. Basically we follow the same policy as in Volto for definition of breaking.

I will have a closer look now.

Yes, in order to make the Hamburger menu overridable, an additional container is required. Since the Burger Menu styles come from Volto and are applied to .hamburger elements, I had to change the class hamburger to hamburger-toggler and include an additional hamburger element inside the MobileNavigationToggler component.

Otherwise, the styles (::before and ::after) would still be applied to the button if the template is customized with another icon.

sneridagh commented 2 months ago

@lenadax merging this now! Thanks for your contribution! I hope it's the first of many others!

FYI, we decided to ship this as a breaking, I think it's important to stick to the definition of breaking. I will take care of it when I make the release, therefore this will be in 4.x series.