Ticket #16667 (closed defect (bug): fixed)
Admin Bar CSS Override Bugs
| Reported by: |
|
Owned by: |
|
|---|---|---|---|
| Priority: | normal | Milestone: | 3.1.1 |
| Component: | UI | Version: | 3.1 |
| Severity: | normal | Keywords: | ui-feedback has-patch |
| Cc: | chexee, saracannon, nacin, ocean90, justin@… |
Description
In 3.1 we introduced a new admin bar. We reset almost all of the CSS properties for the admin bar to prevent themes and plugins from inadvertently affecting its appearance. This ticket is to gather all the properties which we missed out and are coming up as bugs.
Attachments
Change History
comment:1
JohnONolan — 12 months ago
comment:2
JohnONolan — 12 months ago
Positioning problem in K2 theme http://cl.ly/25382W1o3q0z0k2G2v1M
-
attachment
Screen shot 2011-02-25 at 12.36.33 PM.png
added
li a { color } if !important is declared.
comment:3
JohnONolan — 12 months ago
That'll happen if [anything] { anything !important } is declared (at the moment)
comment:5
follow-up:
↓ 7
JohnONolan — 12 months ago
User/Site image needs fixed height/width defined in CSS - http://d.pr/kG34
comment:6
follow-up:
↓ 9
JohnONolan — 12 months ago
Workaround for oversized user/site image
add_action('admin_head', 'nav_bar_fix');
function nav_bar_fix() {
echo '
<style type="text/css">
#wpadminbar .quicklinks li#wp-admin-bar-my-account-with-avatar > a img {width:16px; height 16px;}
</style>
';
}
Replying to JohnONolan:
User/Site image needs fixed height/width defined in CSS - http://d.pr/kG34
We are using $avatar = get_avatar( get_current_user_id(), 16 ) in core, how can it be bigger then 16px?
Replying to ocean90:
Replying to JohnONolan:
User/Site image needs fixed height/width defined in CSS - http://d.pr/kG34
We are using $avatar = get_avatar( get_current_user_id(), 16 ) in core, how can it be bigger then 16px?
At least firefox prefers to show an img in its full size when it is bigger than the width and height attributes.
comment:9
in reply to:
↑ 6
jtsternberg — 12 months ago
Replying to JohnONolan:
Workaround for oversized user/site image
add_action('admin_head', 'nav_bar_fix'); function nav_bar_fix() { echo ' <style type="text/css"> #wpadminbar .quicklinks li#wp-admin-bar-my-account-with-avatar > a img {width:16px; height 16px;} </style> '; }
This fix is only needed if you have replaced the default gravatar with your own image that's larger than 16 px. Also the fix above needs a small tweak to fix the avatar display on the front end also:
add_action('wp_head', 'nav_bar_fix');
add_action('admin_head', 'nav_bar_fix');
function nav_bar_fix() {
echo '<style type="text/css">
#wpadminbar .quicklinks li#wp-admin-bar-my-account-with-avatar > a img {width:16px; height 16px;}
</style>';
}
comment:12
nerx — 12 months ago
- Severity changed from normal to major
Should actually be Priority: High - Having problems with my Admin Bar CSS because of #16667!
comment:13
nacin — 12 months ago
- Severity changed from major to normal
This really isn't major. The admin bar is opt-out, and a theme can also specify its own CSS.
comment:14
in reply to:
↑ 7
greuben — 12 months ago
Replying to ocean90:
Replying to JohnONolan:
User/Site image needs fixed height/width defined in CSS - http://d.pr/kG34
We are using $avatar = get_avatar( get_current_user_id(), 16 ) in core, how can it be bigger then 16px?
This is happening with buddypress installed. They use get_avatar filter to alter avatars.
comment:15
ryan — 11 months ago
comment:16
ryan — 11 months ago
johnjamesjacoby — 11 months ago
-
attachment
admin-bar-my-account.diff
added
Fixes issue where second level menus on my-account menu have 30px left gap
comment:17
follow-up:
↓ 18
johnjamesjacoby — 11 months ago
Note: Above 'admin-bar-my-account.diff' patch is for when the my-account menu includes an avatar, and a plugin has added an additional second level menu. Planning on using this technique in BuddyPress/bbPress (unless a better solution is out there.)
johnjamesjacoby — 11 months ago
-
attachment
admin-bar-my-account-image.png
added
Screen shot of problem that 'admin-bar-my-account.diff' fixes
comment:18
in reply to:
↑ 17
azaozz — 11 months ago
Replying to johnjamesjacoby:
Patch looks good. I would even add another ul in there in case a plugin adds another level of submenus:
#wpadminbar .quicklinks li#wp-admin-bar-my-account-with-avatar ul ul,
#wpadminbar .quicklinks li#wp-admin-bar-my-account-with-avatar ul ul ul {
left: 0;
}
BTW without support for IE6 that would have been a lot simpler, but we are on the front end so... :)
comment:19
follow-up:
↓ 22
nacin — 11 months ago
While avatar > ul > ul would not be enough to cover an additional level of submenus, ul ul should be enough.
comment:20
azaozz — 11 months ago
comment:21
azaozz — 11 months ago
comment:22
in reply to:
↑ 19
azaozz — 11 months ago
Replying to nacin:
Agree, not sure why in my test it didn't show the first time.
comment:23
nacin — 11 months ago
- Status changed from new to closed
- Resolution set to fixed
This looks good for 3.1.1, I don't see anything else unresolved here. New tickets can be opened for future releases as appropriate.
comment:24
jtsternberg — 8 months ago
- Cc justin@… added
- Status changed from closed to reopened
- Resolution fixed deleted
Found another bug conflicting with themes, specifically Genesis.

CSS3 Transitions breaking http://jackosborne.co.uk/articles/wordpress-admin-bar/