Add more collapsed navigation icon options
Currently, there are only two icons for when the navigation block is collapsed.
Having more options would be great.
This is an example of a collection of 340 styles on Figma:
is it assigned to anyone?
Assign it to me.
@sahiladit are you going to implement more hamburger menu styles? do you need help with that?
I am new here, i can chamge it,in which repo i need to make chenge?
Hello @tomxygen @jordesign, I have attempted to make this enhancement in my PR(https://github.com/WordPress/gutenberg/pull/70086). Your feedbacks are appreciated.
Here's a proposal for the Icon/Vector registration API, which can be used to improve the experience for the Navigation icons - #53510.
Reposting @karmatosed's comment for visibility.
Thank you for this PR, in this case I would potentially suggest a little thought should be given to even add icons. Let's take a step back and think about approaches such as #53510 and if having an API for this might be a better method.
My recommendation would be we don't in this case add more icons but look at making it easier for anyone to add their own and then people can take the options from there.
I am really cautious about doing this. Apologies for taking some time in replying. My initial thought is to say we don't do this and leave it up to plugins to have a solution or yes have an API. I don't think offering more options at the point makes sense. We never will have the 'perfect one' if the use case is not having enough icons, so in that case an API is what the user needs.
Note that an experimental API for SVG registration has been implemented: https://github.com/WordPress/gutenberg/pull/72215
We will prioritize stabilizing this API and then consider applying it to the Navigation block as well.
The icons are build with SVG. The icons can be be customized by CSS. Adding all the options and all the code, that needs to be maintained is not worth as the customization via CSS is simple.
For example via theme.json:
[...]
"core/navigation": {
"css": "& .wp-block-navigation__responsive-container-open svg path:nth-child(2){transform-box:fill-box;transform-origin:left center;transform:scaleX(0.4);} & .wp-block-navigation__responsive-container-open svg path:nth-child(3){transform-box:fill-box;transform-origin:left center;transform:scaleX(0.6);}",
[...]
Thanks for the suggestion, @ResponsiveFlow! Choosing different or custom icons for the collapsed Navigation menu is tracked in #37930. The latest direction there is to build on the new icon registration API from WordPress 7.1 instead of adding more hard-coded icons. I'm closing this in favour of that issue, so please follow #37930 for updates.