Problem/Motivation

I would consider this to be a UX bug. Currently if you place an entity in a menu hierarchy under a main navigation entity and then visit that entity, there is no indication that the parent entity is in the active trail.

The menu-item--active-trail class is applied to the parent menu item, we just need CSS definitions to create some visual distinction.

Proposed resolution

Create CSS definitions that provide visual distinctions between regular main navigation items and those in the active trail.

Remaining tasks

  1. Determine how main navigation active trail menu items should look.
  2. Write CSS definitions.

User interface changes

None.

API changes

None.

Beta phase evaluation

Reference: https://www.drupal.org/core/beta-changes
Issue category Bug because Bartik is currently missing a feature to help with usability.
Issue priority Normal because menus are not completely broken.
Unfrozen changes Unfrozen because it only changes CSS.
Disruption Non distruptive

Comments

emma.maria’s picture

Issue tags: +CSS, +frontend

Taggin'

emma.maria’s picture

Issue tags: +Usability
lewisnyman’s picture

Issue tags: +Novice

Nice, this sounds like something that is easy to achieve without a lot of design bikeshedding. We just need a color or some kind of indicator that is inline with the current design. I think someone should patch it and then we review the design change.

Tagging with novice as it is should be simple styling

Bojan Zivkov’s picture

StatusFileSize
new546 bytes

I changed the background opacity for items in the active trail. It is the subtle difference and visible enough to do the job.

Bojan Zivkov’s picture

Status: Active » Needs review
Bojan Zivkov’s picture

emma.maria’s picture

Status: Needs review » Needs work

Hey @Bojan Živkov thanks for the patch.

Due to recent commits in core the patch does not apply anymore so I rerolled.

From looking in the CSS files I noticed we have this code...

#page,
#main-wrapper,
.region-primary-menu .menu-item a.is-active,
.region-primary-menu .menu-item .menu-item--active-trail a {
  background: #ffffff;
}

.region-primary-menu .menu-item .menu-item--active-trail a should be targeting the .menu-item--active-trail list item but the selector is currently incorrect.

Can we please write a new patch that amends the code above and targets the active trail correctly.

Cinnead’s picture

Assigned: Unassigned » Cinnead
Cinnead’s picture

StatusFileSize
new534 bytes

Rewrote the patch, the previous one didn't work anymore because of changes to the primary-menu.css file.

Cinnead’s picture

Assigned: Cinnead » Unassigned
Status: Needs work » Needs review
emma.maria’s picture

Status: Needs review » Needs work

For the style of the active trail we need to use:

background: #ffffff;

This is existing code in Bartik for active trail menu items which you can find in colors.css.
It is not working currently because the selector is slightly incorrect so we just need a small change to existing code for this issue.

#page,
#main-wrapper,
.region-primary-menu .menu-item a.is-active,
.region-primary-menu .menu-item .menu-item--active-trail a {
  background: #ffffff;
}
haasontwerp’s picture

StatusFileSize
new471 bytes

Corrected css selector.

haasontwerp’s picture

Status: Needs work » Needs review
haasontwerp’s picture

StatusFileSize
new800.62 KB
new760.12 KB

Added before and after screenshots.

emma.maria’s picture

Issue summary: View changes
Status: Needs review » Needs work
StatusFileSize
new149.17 KB

Thanks @haasontwerp for the patch.

The visual changes are perfect!
 

 
However I need one improvement for the code.

For the active trail selector...

.region-primary-menu .menu-item.menu-item--active-trail a

We need to remove the .menu-item part of it and just have....

.region-primary-menu .menu-item--active-trail a

This is because .menu-item--active-trail is a variant class of .menu-item so it does not need to be declared twice.

Cinnead’s picture

Removed the menu-item selector because it doesn't needs to be declared twice.

Cinnead’s picture

Assigned: Unassigned » Cinnead
Cinnead’s picture

Assigned: Cinnead » Unassigned
Status: Needs work » Needs review
emma.maria’s picture

Issue tags: +drupaldevdays
emma.maria’s picture

Status: Needs review » Reviewed & tested by the community

The CSS selector is now correct and the changes in #16 do not affect anything visually from the patch in #12.

Setting this issue to RTBC. Thanks all!

emma.maria’s picture

Issue summary: View changes

Added beta evaluation

  • alexpott committed f7996a9 on 8.0.x
    Issue #2462459 by Cinnead, Bojan Živkov, haasontwerp, emma.maria: Active...

Status: Reviewed & tested by the community » Needs work

The last submitted patch, 16: active_trail_menu_items-2462459-16.patch, failed testing.

emma.maria’s picture

Status: Needs work » Fixed

Status: Fixed » Closed (fixed)

Automatically closed - issue fixed for 2 weeks with no activity.