WordPress.org

Make WordPress Core

Opened 6 years ago

Last modified 3 weeks ago

#32579 new defect (bug)

Admin menu: color schemes fly-out menu background when focused

Reported by: afercia Owned by:
Milestone: Priority: normal
Severity: normal Version: 4.2
Component: Administration Keywords: has-patch
Focuses: ui, css Cc:

Description

Small visual glitch about Sass color schemes, please refer to the screenshot below.
To reproduce:

  • set a color scheme (here it's "Ocean" which doesn't use dark backgrounds and makes this clear)
  • collapse the admin menu
  • tab with your keyboard and focus the current top menu item

On the left when focused, on the right when hovered. Also, notice a (minor) inconsistency about the displaying of the small arrow.

https://cldup.com/IYFktm3ZwB.png

Attachments (5)

32579.diff (1.1 KB) - added by ryelle 6 years ago.
32579.2.diff (2.4 KB) - added by afercia 5 years ago.
dropdown-focus-before.png (257.5 KB) - added by ryelle 3 weeks ago.
dropdown-focus.diff (2.6 KB) - added by ryelle 3 weeks ago.
dropdown-focus-after.png (254.3 KB) - added by ryelle 3 weeks ago.

Download all attachments as: .zip

Change History (10)

@ryelle
6 years ago

#1 @ryelle
6 years ago

32579.diff adds the :focus'd submenu selector to the color schemes, so they get the correct colors per-scheme. It also removes the small arrow when the item is focused or the menu is open.

#2 @Bueltge
6 years ago

  • Keywords has-patch added; needs-patch removed

The patch works fine, tested in this scenario with mouse and keyboard, focus and hover.

But is it also a difference on the box-shadow. The box-shadow is missed on focus, hover for a active item of the menu. This difference was clear for me. But I don't know what is the goal, with or without box-shadow. Currently is not always the same. Maybe a topic for new ticket? This topic here was solved, but leave a open new topic.

The source is in wp-admin/css/admin-menu.css.

#adminmenu .wp-submenu,
.folded #adminmenu a.wp-has-current-submenu:focus + .wp-submenu,
.folded #adminmenu .wp-has-current-submenu .wp-submenu {
	padding: 7px 0 8px;
	z-index: 9999;
	background-color: #32373c;
	-webkit-box-shadow: 0 3px 5px rgba(0,0,0,0.2);
	box-shadow: 0 3px 5px rgba(0,0,0,0.2);
}

and

#adminmenu .wp-has-current-submenu .wp-submenu,
.no-js li.wp-has-current-submenu:hover .wp-submenu,
#adminmenu a.wp-has-current-submenu:focus + .wp-submenu,
#adminmenu .wp-has-current-submenu .wp-submenu.sub-open,
#adminmenu .wp-has-current-submenu.opensub .wp-submenu {
	position: relative;
	z-index: 3;
	top: auto;
	left: auto;
	right: auto;
	bottom: auto;
	border: 0 none;
	margin-top: 0;
	-webkit-box-shadow: none;
	box-shadow: none;
	background-color: #32373c;
}

You see this shadow topic also on the screenshots from the reporter.

Last edited 6 years ago by Bueltge (previous) (diff)

@afercia
5 years ago

#3 @afercia
5 years ago

Refreshed patch. Would love the admin menu to be simpler but there's nothing simple here :) It's extremely difficult to keep track of all the possible menu states but I've tried to do my best. What I'm trying to do in this patch:

  • separate and simplify the rules for the box-shadow so it's applied and reset just in two places
  • remove the small arrow on the current item also when the menu is in auto-fold state

Would definitely need some testing. @ryelle @Bueltge would greatly appreciate your help when you get a chance :)

To recap there are at least 4 states to test:

  • expanded (default on large screens)
  • folded (user intentionally collapsed the menu)
  • auto-fold with a viewport less than 782px
  • auto-fold with a viewport greater than 782px
Last edited 5 years ago by afercia (previous) (diff)

#4 @ryelle
3 weeks ago

#47132 was marked as a duplicate.

#5 @ryelle
3 weeks ago

  • Focuses css added

dropdown-focus-before.png shows that this is still an issue on trunk. I've taken a stab at fixing it in dropdown-focus.diff by deleting a bunch of folded-specific CSS, which apparently wasn't necessary. I also tweaked the box-shadow rules so it applies to the current menu, it works on hover and when child-items are focused, but I just noticed it's not right in my screenshots. It's a step in the right direction though.

dropdown-focus-after.png shows the after, the menu backgrounds are all correct and the light-colored arrow is gone.

Note: See TracTickets for help on using tickets.