gutenberg icon indicating copy to clipboard operation
gutenberg copied to clipboard

Add more collapsed navigation icon options

Open ResponsiveFlow opened this issue 2 years ago • 11 comments

Currently, there are only two icons for when the navigation block is collapsed. Screenshot 2024-05-17 at 10 07 49 AM

Having more options would be great.

This is an example of a collection of 340 styles on Figma:

35ce2236e9e879b6a2645a1b9225a44223479727

ResponsiveFlow avatar May 17 '24 08:05 ResponsiveFlow

is it assigned to anyone?

badaya12 avatar May 18 '24 11:05 badaya12

Assign it to me.

sahiladit avatar May 19 '24 08:05 sahiladit

@sahiladit are you going to implement more hamburger menu styles? do you need help with that?

ResponsiveFlow avatar May 22 '24 14:05 ResponsiveFlow

I am new here, i can chamge it,in which repo i need to make chenge?

sahiladit avatar May 22 '24 14:05 sahiladit

Hello @tomxygen @jordesign, I have attempted to make this enhancement in my PR(https://github.com/WordPress/gutenberg/pull/70086). Your feedbacks are appreciated.

Ta5r avatar May 08 '25 13:05 Ta5r

Here's a proposal for the Icon/Vector registration API, which can be used to improve the experience for the Navigation icons - #53510.

Mamaduka avatar Aug 04 '25 08:08 Mamaduka

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.

Mamaduka avatar Sep 03 '25 04:09 Mamaduka

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.

karmatosed avatar Sep 30 '25 10:09 karmatosed

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.

t-hamano avatar Feb 02 '26 03:02 t-hamano

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);}",
[...]				

Drivingralle avatar Jun 04 '26 12:06 Drivingralle

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.

youknowriad avatar Oct 17 '26 16:10 youknowriad