Make WordPress Core

Opened 11 years ago

Closed 11 years ago

#26200 closed enhancement (fixed)

Twenty Fourteen: Drop Down Menu icons

Reported by: binarymoon's profile binarymoon Owned by: lancewillett's profile lancewillett
Milestone: 3.8 Priority: normal
Severity: normal Version: 3.8
Component: Bundled Theme Keywords: has-patch
Focuses: Cc:

Description

Don't know if this is desirable or not - but personally I find it much easier to use a sites navigation when there's some way to tell if a menu has a sub-menu (drop down) - however 2014 currently doesn't do this.

I've attached a mockup of what I would do. I've actually made it work so can add a patch if anyone wants to test. Would need to be tweaked so that it works well with rtl languages but otherwise it works fine for ltr.

Attachments (7)

Screenshot 2013-11-24 14.53.34.png (63.3 KB) - added by binarymoon 11 years ago.
screenshot showing what I would do with the menus for 2014 to show when there is a dropdown available
TwentyFourteenMenu.patch (1.7 KB) - added by binarymoon 11 years ago.
A patch that adds the little icons to the menu items for both the ltr and rtl
TwentyFourteenMenu.2.patch (1.7 KB) - added by binarymoon 11 years ago.
updated code (for coding standards) and fixed issue with arrows displaying on mobile menu
TwentyFourteenMenu.3.patch (1.6 KB) - added by binarymoon 11 years ago.
made the arrows a pixel smaller (it feels better) and exported the code on the command line which should sort out the coding standards issues
TwentyFourteenMenu.4.patch (1.9 KB) - added by binarymoon 11 years ago.
tweak arrow position, and make secondary navigation styles work
26200.5.diff (3.4 KB) - added by iamtakashi 11 years ago.
26200.rtl.diff (1.2 KB) - added by yoavf 11 years ago.

Download all attachments as: .zip

Change History (29)

@binarymoon
11 years ago

screenshot showing what I would do with the menus for 2014 to show when there is a dropdown available

#1 follow-up: @binarymoon
11 years ago

Kind of related to this - I am a little obsessed with css transitions at the moment. Is there any reason to not add them to the menus to add a subtle fade in and out?

@binarymoon
11 years ago

A patch that adds the little icons to the menu items for both the ltr and rtl

#2 @binarymoon
11 years ago

  • Type changed from defect (bug) to enhancement

#3 in reply to: ↑ 1 @celloexpressions
11 years ago

Replying to binarymoon:

Kind of related to this - I am a little obsessed with css transitions at the moment. Is there any reason to not add them to the menus to add a subtle fade in and out?

#25553, unfortunately.

Anyway, I like this. Remember seeing a ticket for this for Twenty Thirteen, can't find it, but I believe there was a technical issue with it. Your patch looks very concise and works (does need coding standards clean up, doesn't need the .primary-navigation ul ul a part, didn't check rtl, shouldn't happen for mobile), though, so I think the only limit would be whether we want it in the design.

Worth noting that it is very useful to have indicators that there's a dropdown for touch users. This tells the user that they need to play the try-to-trigger-the-submenu-but-not-the-link game or allows them to utilize the browser's solution to that issue (pressing and holding in IE11, for example).

#4 follow-up: @binarymoon
11 years ago

Thanks for letting me know about the transitions. Shame, but agreed consistency is good.

The ".primary-navigation ul ul a" bit is there so that all menu items stretch to full width (which is only visible when there's an item being hovered). Could use box-sizing instead so that the padding gets absorbed? Or could just remove - but does mean there's a gap in some situations (when there's sub sub menus).

Have tidied up the css - hopefully that's all that's needed in terms of css coding standards? Gonna add a patch in a sec.

@binarymoon
11 years ago

updated code (for coding standards) and fixed issue with arrows displaying on mobile menu

#5 in reply to: ↑ 4 ; follow-up: @celloexpressions
11 years ago

Replying to binarymoon:

The ".primary-navigation ul ul a" bit is there so that all menu items stretch to full width (which is only visible when there's an item being hovered). Could use box-sizing instead so that the padding gets absorbed? Or could just remove - but does mean there's a gap in some situations (when there's sub sub menus).

Oh, I see the gap now. I had ended up with max-width there instead of min-width, so it was messing up the layout. Leave that in.

Have tidied up the css - hopefully that's all that's needed in terms of css coding standards? Gonna add a patch in a sec.

I think you got everything except "tabs, not spaces" for indentation. There's also a space at the end of each line that should be removed (I'm guessing your text editor added those). Patches should also be made relative to the WordPress root.

#6 @binarymoon
11 years ago

Thanks for the infos. I think Netbeans must be messing up the formatting when I export the patch since I already use tabs, and have netbeans set to trim whitespace from the end of lines. I'll have to see if I can use something else to export the patch file - I guess I could always try to do it on the command line :)

@binarymoon
11 years ago

made the arrows a pixel smaller (it feels better) and exported the code on the command line which should sort out the coding standards issues

#7 @rachelbaker
11 years ago

  • Cc rachel@… added

#8 @janhenckens
11 years ago

  • Cc janhenckens added

#9 @iamtakashi
11 years ago

I'm not against this idea but I'm curious why it's removed from Twenty Thirteen.

@binarymoon,
if we add arrows, we definitely need to do for the fly-out secondary navigation also.

For the primary navigation, I'd position the arrows align vertically to the middle rather than the top as it's currently, and little more closer to each menu item.

#10 follow-up: @binarymoon
11 years ago

Hey Takashi - in my diff the icons are pointing right on the secondary flyouts so hopefully that's ok. Happy to tweak the position slightly also.

I'm intrigued to know why they weren't used in 2013 also.

#11 in reply to: ↑ 10 @iamtakashi
11 years ago

Replying to binarymoon:

Hey Takashi - in my diff the icons are pointing right on the secondary flyouts so hopefully that's ok. Happy to tweak the position slightly also.

I meant the secondary navigation on the left sidebar, not the third level menu item in the primary navigation.

#12 @binarymoon
11 years ago

ah - gotcha. Didn't realise those did the dropdown thing. Will have a look at that this evening and see if I can add it in.

#13 @iamtakashi
11 years ago

  • Cc takashi@… added

#14 in reply to: ↑ 5 @SergeyBiryukov
11 years ago

Replying to celloexpressions:

I think you got everything except "tabs, not spaces" for indentation. There's also a space at the end of each line that should be removed (I'm guessing your text editor added those).

FWIW, TwentyFourteenMenu.2.patch looks good to me in terms of formatting. It uses tabs and doesn't actually have spaces at the end of each line. It's just how Trac displays it.

Last edited 11 years ago by SergeyBiryukov (previous) (diff)

#15 @binarymoon
11 years ago

Thanks for the confirmation Sergey! :)

@binarymoon
11 years ago

tweak arrow position, and make secondary navigation styles work

#16 @celloexpressions
11 years ago

Finally found the Twenty Thirteen ticket (they turned it into a core ticket, should've made a new one): #23834.

The only hold-up was the lack of the has-children class. Now that that's available, we should make it happen (could also revisit it for Twenty Thirteen).

@iamtakashi
11 years ago

#17 @iamtakashi
11 years ago

  • Keywords has-patch added
  • Version set to trunk

@binarymoon

I worked on this a bit further and made a patch 26200.5.diff based on yours. Here are notes for you and I hope you find these useful.

  • The arrows need be added separately to the primary and the secondary navigation with different break points because the secondary navigation remains the mobile style until wider browser width. With your patch, arrows for the secondary navigation had appeared weird places when browser width is between from 782px to 810px.
  • The arrows should also be added to the fallback page menu so that users who don't set a custom menu also see the arrows.
  • Making the width of .primary-navigation ul ul a flexible with min-width does prevent the gap but I'd like to keep the width of the children the same regardless having grand children or not.
  • I believe there is no need to specify sizes of the arrow with width: 0 and height: 0, and restating it as block element.
  • I made the arrow a little bit smaller and tweaked its position.
  • Let's use double quotes per CSS coding standards.
  • I personally like ordering properties alphabetically with certain exceptions.

This is an awesome suggestion, thank you!

#18 @binarymoon
11 years ago

@iamtakashi - that's great. Awesome to see it being included :)

Thanks also for the pointers on the improvements you made.

#19 @lancewillett
11 years ago

  • Milestone changed from Awaiting Review to 3.8

#20 @lancewillett
11 years ago

  • Owner set to lancewillett
  • Resolution set to fixed
  • Status changed from new to closed

In 26587:

Twenty Fourteen: enhance main navigation usability by adding in visual indicators for existence of submenu items. Props binarymoon, iamtakashi. Fixes #26200.

#21 @yoavf
11 years ago

  • Resolution fixed deleted
  • Status changed from closed to reopened

RTL in this changeset wasn't good enough - attaching patch

@yoavf
11 years ago

#22 @nacin
11 years ago

  • Resolution set to fixed
  • Status changed from reopened to closed

In 26796:

Twenty Fourteen: RTL fixes for the navigation.

props yoavf.
fixes #26200.

Note: See TracTickets for help on using tickets.