Make WordPress Core

Opened 11 years ago

Closed 3 weeks ago

Last modified 3 weeks ago

#26960 closed enhancement (fixed)

Audit extraneous HTML/CSS for the admin menu

Reported by: helen's profile helen Owned by: pbearne's profile pbearne
Milestone: 6.8 Priority: low
Severity: normal Version:
Component: Administration Keywords: has-patch
Focuses: ui, performance Cc:

Description

In working on #18380, I've noticed quite a bit of cruft that has built up over time, some of it directly related to the split between colors and structure. For example, the .wp-menu-arrow is no longer visible in the 3.8 redesign, but the HTML and CSS remain. Once #18380 and #26669 are complete, we should take a closer look at this.

Attachments (1)

removed_unused_wp-menu-arrow.patch (6.3 KB) - added by jbkkd 11 years ago.
from #29200

Download all attachments as: .zip

Change History (15)

#1 @azaozz
11 years ago

Yes, it's a solid chunk of HTML with far too many classes. There are about 800-900 lines of CSS (including colors), I bet it doesn't need more than 200-250 :)

The way it works can be simpler too. Not sure it needs the user controllable auto-fold at 900px as it goes into "mobile" mode at 782px.

#2 @johnbillion
11 years ago

  • Component changed from General to Administration
  • Milestone changed from 3.9 to Future Release
  • Priority changed from normal to low
  • Type changed from defect (bug) to enhancement

#3 @helen
11 years ago

#28934 was marked as a duplicate.

#4 @helen
11 years ago

#29200 was marked as a duplicate.

#5 @chriscct7
9 years ago

  • Keywords has-patch needs-refresh added

#6 @pbearne
2 months ago

  • Owner set to pbearne
  • Status changed from new to assigned

refreshing patch

This ticket was mentioned in PR #8016 on WordPress/wordpress-develop by @pbearne.


2 months ago
#7

  • Keywords needs-refresh removed

…s break down the changes:

  • src/wp-admin/menu-header.php: The primary change is the removal of the $arrow variable and its inclusion in the menu item's HTML. Every instance of $arrow within the <a> tag has been deleted. This directly removes the arrow element from the rendered output.
  • src/wp-admin/css/admin-menu.css: The CSS changes further support the removal of the arrow. The rules related to .wp-menu-arrow are removed. Specifically:
    • #adminmenu li.wp-has-current-submenu a.wp-has-current-submenu, #adminmenu li.current a.menu-top, #adminmenu .wp-menu-arrow, #adminmenu .wp-has-current-submenu .wp-submenu .wp-submenu-head, #adminmenu .wp-menu-arrow div is changed to remove .wp-menu-arrow and .wp-menu-arrow div. This removes styling for the arrow itself and for parent menu items.
    • The /* A new arrow */ comment block and the following .wp-menu-arrow style block, which hid the arrow (display: none !important;), is completely deleted. Since the arrow element is no longer present in the HTML, these styles are unnecessary.

In summary, these changes effectively delete the arrow that typically appears next to WordPress admin menu items that have submenus. The HTML generating the arrow is removed, and the corresponding CSS styling is deleted. This results in a cleaner, more minimalist look for the admin menu.

#8 @pbearne
2 months ago

  • Milestone set to 6.8

#9 @flixos90
4 weeks ago

I'm happy to give this a review and test. If it only removes HTML and CSS that isn't meaningful in any way, that should not be too controversial of a change.

That said, it would still be good to get UI and design input here. @karmatosed Are you able to help out here potentially?

This ticket was mentioned in Slack in #core-performance by swissspidy. View the logs.


4 weeks ago

#11 @flixos90
4 weeks ago

@helen It looks like the PR https://github.com/WordPress/wordpress-develop/pull/8016 is a good attempt at removing the unnecessary .wp-menu-arrow HTML and CSS.

While you mention that in the description, the ticket is also about further auditing, which seems a much larger effort. Would you like for it to remain that way, or should we mark it as fixed by the .wp-menu-arrow removal?

#12 @audrasjb
3 weeks ago

I think we can start with this changeset and open new tickets if any related improvements are identified :)

#13 @audrasjb
3 weeks ago

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

In 59690:

Administration: Remove useless arrow icon from WordPress admin menu.

This changeset deletes the arrow that is typically added next to WordPress admin menu items that have submenus. The .wp-menu-arrow element is no longer visible since the WP 3.8 redesign, but the HTML and CSS remained. With this changeset, the HTML generating the arrow is removed, and the corresponding CSS styling is deleted.

Props helen, azaozz, jbkkd, pbearne, flixos90.
Fixes #26960.

Note: See TracTickets for help on using tickets.