[wp-trac] [WordPress Trac] #26630: Plugin Dashicons in admin menu have a glitch in IE

WordPress Trac noreply at wordpress.org
Sun Feb 23 15:24:38 UTC 2014


#26630: Plugin Dashicons in admin menu have a glitch in IE
----------------------------+------------------
 Reporter:  TobiasBg        |       Owner:
     Type:  defect (bug)    |      Status:  new
 Priority:  normal          |   Milestone:  3.9
Component:  Administration  |     Version:  3.8
 Severity:  normal          |  Resolution:
 Keywords:  has-patch       |     Focuses:  ui
----------------------------+------------------
Changes (by ocean90):

 * keywords:   => has-patch
 * milestone:  Awaiting Review => 3.9


Comment:

 [attachment:26630.2.patch] is the way we should go.

 The `.dashicon` class is pretty useless here. We have the styles already
 in `div.wp-menu-image:before`. I also noticed that the Dashicon height was
 defined as 36px and width as 20px - a Dashicon is build for grid of
 20x20px which shouldn't be changed, at least not different from each side.
 A side effect of this was, that the images aren't vertically centered. A
 Dashicon's height is now 20px. With 7px padding for top and bottom we're
 in line with an item height of 34px. This also affects SVG icons.

 My testcode:

 {{{
 function add_my_plugin_icon_to_menu() {
         add_menu_page( 'My Plugin', 'My Plugin', 'read', 'my_plugin',
 '__return_true', 'dashicons-list-view' );

         $svg =
 'data:image/svg+xml;base64,PD94bWwgdmVyc2lvbj0iMS4wIiBlbmNvZGluZz0idXRmLTgiPz4NCjwhLS0gR2VuZXJhdG9yOiBBZG9iZSBJbGx1c3RyYXRvciAxNS4wLjAsIFNWRyBFeHBvcnQgUGx1Zy1JbiAuIFNWRyBWZXJzaW9uOiA2LjAwIEJ1aWxkIDApICAtLT4NCjwhRE9DVFlQRSBzdmcgUFVCTElDICItLy9XM0MvL0RURCBTVkcgMS4xLy9FTiIgImh0dHA6Ly93d3cudzMub3JnL0dyYXBoaWNzL1NWRy8xLjEvRFREL3N2ZzExLmR0ZCI+DQo8c3ZnIHZlcnNpb249IjEuMSIgaWQ9IkxheWVyXzEiIHhtbG5zPSJodHRwOi8vd3d3LnczLm9yZy8yMDAwL3N2ZyIgeG1sbnM6eGxpbms9Imh0d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ZD0iTTE3NS42MTIsNTUuMTEzaC03MS4xMzZjLTE0LjM3OCwwLTE0LjM3OC0yMS41NjYsMC0yMS41NjZoNzEuMzExaDc0Ljc2MWMxNC4zNzgsMCwxNC4zNzgsMjEuNTY2LDAsMjEuNTY2SDE3NS42MTJ6Ii8+DQoJCTwvZz4NCgkJPGc+DQoJCQk8cGF0aCBkPSJNMTc1LjYxMiw3Ni44ODdINjUuNzE1Yy0xNS4xODgsMC0xOS4xNTYsNy43MTctMjEsMTkuNDIzbC0xMy40MjgsOTYuMzQ4Yy0xLjI1Miw5LjIzNSwxLjQxOSwxOC40MDIsMTQuMTc4LDE4LjQwMg0KCQkJCWgxMzAuMzIyaDEzMy43NzJjMTIuNzU5LDAsMTUuNDMtOS4xNjcsMTQuMTc4LTE4LjQwMkwzMTAuMzA5LDk2LjMxYy0xLjg0NC0xMS43MDYtNS44MTItMTkuNDIzLTIxLTE5LjQyM0gxNzUuNjEyeiIvPg0
 KCQk8L2c+DQoJPC9nPg0KPC9nPg0KPC9zdmc+DQo=';
         add_menu_page( 'My Plugin 2', 'My Plugin 2', 'read',
 'my_plugin_2', '__return_true', $svg );

         $image = 'https://make.wordpress.org/core/wp-
 content/plugins/jetpack/modules/contact-form//images/grunion-menu.png';
         add_menu_page( 'My Plugin 3', 'My Plugin 3', 'read',
 'my_plugin_3', '__return_true', $image );

         add_menu_page( 'My Plugin 4', 'My Plugin 4', 'read',
 'my_plugin_4', '__return_true', 'none' );
 }
 add_action( 'admin_menu', 'add_my_plugin_icon_to_menu' );
 }}}

--
Ticket URL: <https://core.trac.wordpress.org/ticket/26630#comment:4>
WordPress Trac <https://core.trac.wordpress.org/>
WordPress publishing platform


More information about the wp-trac mailing list