Problem/Motivation

The following applies only to the Gin toolbar at breakpoints < 976px, when toolbar-tray switches from horizontal to vertical.

When the Gin toolbar is set to either Horizontal, Modern OR Legacy, Classic, Gin applies background shading to sub-menus to help illustrate the parent/child relationship, and distinguish the active menu items from other items in the toolbar (since they all have identical margins).

Shaded Sub-Menus in Horizontal or Legacy toolbars below 976px
Sub-menu shading in the Gin horizontal toolbar.

When the Sidebar, Vertical Toolbar is selected, this shading is not applied to the sub-menus. See the screenshot below:

Un-shaded Sub-Menus in Vertical or toolbar below 976px
Gin Vertical toolbar sub-menus < 976px

Steps to reproduce

  • Enable Gin (and Gin Toolbar to test on the front-end)
  • Select 'Sidebar, Vertical Toolbar' for the Navigation setting (/admin/appearance/settings/gin)
  • Set the browser window to a width of less than 976px
  • Click 'Manage' and navigate down the menu structure.

Proposed resolution

Copy the CSS that provides sub-menu background shading from horizontal_toolbar.css, e.g.

.toolbar .level-2 > ul,
.gin--dark-mode .toolbar .toolbar-toggle-orientation {
  background-color: var(--gin-bg-layer2);
}

.toolbar .level-3 > ul {
  background-color: var(--gin-bg-app);
}

Remaining tasks

Patch
Review
Commit

User interface changes

Add sub-menu background colors for the Vertical toolbar at breakpoints < 976px.

API changes

None

Data model changes

None

Issue fork gin-3336271

Command icon Show commands

Start within a Git clone of the project using the version control instructions.

Or, if you do not have SSH keys set up on git.drupalcode.org:

Comments

justcaldwell created an issue. See original summary.

justcaldwell’s picture

Category: Feature request » Bug report
StatusFileSize
new71.07 KB

Changing to a bug report as I've just realized that sub-menus do have a different background color with the Vertical Toolbar in dark mode. So maybe this was just an oversight (?).

Gin vertical sub-menus in dark mode

justcaldwell’s picture

Status: Active » Needs review

I figured out that the nested menu background colors are set for smaller breakpoints in claro's toolbar.css, but layout/toolbar.css overrides them. Moved the rule to the medium media query, et violà!

They should probably be a bit darker, and actually use Gin's color var's (as is done with dark mode) but this is a start.

justcaldwell’s picture

StatusFileSize
new106.9 KB

Here's what the sub-menus look like with Claro's colors in effect:

Claro's styling for sub-menus as smaller screen sizes

nayana_mvr’s picture

Verified the MR!220 and tested it on Drupal version 10.1.x and Gin version 8.x-3.x. After applying patch the background shading to sub-menus is changed for Vertical Toolbar but I think it is not same as the one which is applied when Horizontal, Modern OR Legacy, Classic is used. Attaching screenshots for reference.

Horizontal toolbar
Only local images are allowed.

Vertical toolbar before patch
Only local images are allowed.

Vertical toolbar after patch
Vertical toolbar after patch

justcaldwell’s picture

StatusFileSize
new210.76 KB

Thanks for reviewing @nayana_mvr! Correct, the colors were coming from Claro, so they weren't consistent with the horizontal or legacy toolbar colors. My most recent changes use the same gin color variables used in those other toolbars. Now they're all consistent, and the changes are suitable to merge (IMHO).

Comparison before and after the latest changes.

saschaeggi made their first commit to this issue’s fork.

saschaeggi’s picture

@justcaldwell I've changed a bit the way to handle this. Please have a look. Needs a review.

justcaldwell’s picture

Status: Needs review » Reviewed & tested by the community
StatusFileSize
new64.85 KB

@saschaeggi works fine for me. A screenshot with the latest version of 220 applied (vertical toolbar, light mode). I checked all three toolbars in both light and dark mode. Colors seem consistent across all. Thanks!

saschaeggi’s picture

Status: Reviewed & tested by the community » Fixed

Status: Fixed » Closed (fixed)

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