Make WordPress Core

Opened 8 weeks ago

Closed 7 weeks ago

#64004 closed enhancement (reported-upstream)

Split Hamburger-Icon SVG into three tags to allow more styling and animation

Reported by: drivingralle's profile Drivingralle Owned by:
Milestone: Priority: normal
Severity: normal Version:
Component: Editor Keywords:
Focuses: Cc:

Description

While working on a client project I wanted to animate the menu button on mobile. At first the two line icon ("Handle") was used and the icon could be animated. Later the three line aka "hamburger icon" or "Menu" icon was selected and the animation broke.

Because the "Menu icon" currently is build with a single <path> tag for all three lines, therefore an individual line could not be addressed.

I propose to change the SVG to have three <path> tags to allow animations and styling of each line independently.

--

The "Handle icon" (two lines) is using <rect> tags to draw the lines. I'm not sure if we should also switch to <rect> for the three lines (Menu icon). To make the markup more consistent between the two icons to prevent breaking if the user changes the setting.

Keeping the <path> tag would be more compatible with the old SVG content. Not breaking any existing code.

I have attached patches for booth cases.

--

The "close button icon" uses <path> to draw the X.
To unify the three icons all icons could be done the <path> tags. This changes the markup for two icons - withe the potential of breaking more things.

I attached a patch for that, too.

Attachments (3)

Use_multiple_paths_for_menu_icon.patch (1.3 KB) - added by Drivingralle 8 weeks ago.
Patch to use multiple path tags
Use_multiple_rect_for_menu_icon.patch (1.4 KB) - added by Drivingralle 8 weeks ago.
Patch to use multiple rect tags
Use_path_for_all_navigation_toogle_icons.patch (1.7 KB) - added by Drivingralle 8 weeks ago.
Patch to use path for all navigation icon SVGs

Download all attachments as: .zip

Change History (6)

@Drivingralle
8 weeks ago

Patch to use multiple path tags

@Drivingralle
8 weeks ago

Patch to use multiple rect tags

@Drivingralle
8 weeks ago

Patch to use path for all navigation icon SVGs

#1 @sabernhardt
8 weeks ago

  • Component changed from Menus to Editor

This belongs on the Gutenberg repository because the code is part of the blocks package. Some similar issues exist, but I did not notice a close match.

Could you comment on one of the existing issues or open your own?

#3 @sabernhardt
7 weeks ago

  • Focuses ui removed
  • Milestone Awaiting Review deleted
  • Resolution set to reported-upstream
  • Status changed from new to closed
  • Version 6.8 deleted

Thanks for moving the report!

Note: See TracTickets for help on using tickets.