正确的方法:
#adminmenu div.wp-menu-image:before {
color: #000; <-- here
}
#adminmenu .wp-has-current-submenu div.wp-menu-image:before {
color: #000; <-- here
}
并确保获得所选子菜单的悬停状态
#adminmenu li.wp-has-current-submenu:hover div.wp-menu-image:before,
#adminmenu .wp-has-current-submenu div.wp-menu-image:before,
#adminmenu .current div.wp-menu-image:before,
#adminmenu a.wp-has-current-submenu:hover div.wp-menu-image:before,
#adminmenu a.current:hover div.wp-menu-image:before,
#adminmenu li.wp-has-current-submenu a:focus div.wp-menu-image:before,
#adminmenu li.wp-has-current-submenu.opensub div.wp-menu-image:before {
color: #000; <-- here
}
所有dashicon css和相关wp菜单图像css都位于管理菜单中。css工作表。