Opened 14 years ago
Closed 14 years ago
#17107 closed defect (bug) (fixed)
Theme/plugin CSS can override admin bar parent menu fonts
Reported by: | johnjamesjacoby | Owned by: | |
---|---|---|---|
Milestone: | 3.2 | Priority: | normal |
Severity: | normal | Version: | 3.1 |
Component: | Administration | Keywords: | has-patch |
Focuses: | Cc: |
Description
Attaching a screenshot of the menu-bar when using the Mystique theme as an example of what happens.
Spent a few minutes playing with the admin-bar CSS trying to come up with a patch that didn't conflict with existing CSS but couldn't come up with a solution that didn't replace a bunch of it. Will revisit a patch this week.
The admin bar font is originally applied here to the entire #wpadminbar: http://core.trac.wordpress.org/browser/trunk/wp-includes/css/admin-bar.dev.css#L27
Single link root-level menu items aren't affected in my screen shot because they have specific CSS that prevents it here: http://core.trac.wordpress.org/browser/trunk/wp-includes/css/admin-bar.dev.css#L74
(Putting this in the "Menus" component even though that's meant for Appearance -> Menus. Will probably want to add a dedicated "Admin Bar" component.)
Attachments (4)
Change History (19)
#2
follow-up:
↓ 3
@
14 years ago
Dupe of #16667? It was meant for 3.1.1 but it should probably just be reopened if there is more that can be done. I'll leave it up for someone else to decide.
#3
in reply to:
↑ 2
@
14 years ago
Replying to andrewryno:
Dupe of #16667? It was meant for 3.1.1 but it should probably just be reopened if there is more that can be done. I'll leave it up for someone else to decide.
Nope, once a ticket is closed on a completed milestone, it's time for a new ticket.
#4
follow-up:
↓ 5
@
14 years ago
Wouldn't something like this work there?
#wpadminbar * { font: normal 12px/28px Arial, Helvetica, sans-serif; }
#5
in reply to:
↑ 4
@
14 years ago
Replying to azaozz:
Wouldn't something like this work there?
#wpadminbar * { font: normal 12px/28px Arial, Helvetica, sans-serif; }
Depends how much prevention we're baking in. I initially started including color and text-shadow in addition to the font, and realized it changes for submenus.
I also noticed that the CSS at http://core.trac.wordpress.org/browser/trunk/wp-includes/css/admin-bar.dev.css#L74 bumps the font-size up to 13px for some reason. Wasn't sure if that was intentional or not, so rather than start recoding all the CSS for the conditions I was finding, I opened this ticket.
#6
@
14 years ago
Attached patch moves the main bar font styling up into #wpadminbar *
This works because all of the other core admin bar elements have dedicated styling already to change their respective font sizes, colors, and shadows, including submenus.
As a result, this patch also fixes a small font discrepancy where top level links had a 13px font size, and elements with submenus has a 12px font size.
#7
@
14 years ago
Cool, but I don't necessarily see that as a discrepancy. On my screen 12px looks quite visibly different.
#8
@
14 years ago
I'd be curious as to see what the performance is like of that universal selector, especially with the added font declarations. There's a limited number of elements that would appear in the admin bar, so replacing * with each element (similar to Eric Meyer's reset, HTML5 boilerplate reset, etc.) that is used, and then also only add the font styles to the elements which have a font in them. Also, no specificity should be lost by switching.
Granted, this was probably brought up before when it was initially made, but thought I'd like to bring up the point.
#11
@
14 years ago
Replying to nacin:
Cool, but I don't necessarily see that as a discrepancy. On my screen 12px looks quite visibly different.
To clarify, by "top level links" I meant items that did not have submenus. Items like "Edit Post" and "Comments" were always 13px, but any item with a submenu was 12px.
Replying to andrewryno:
I'd be curious as to see what the performance is like of that universal selector, especially with the added font declarations. There's a limited number of elements that would appear in the admin bar, so replacing * with each element (similar to Eric Meyer's reset, HTML5 boilerplate reset, etc.) that is used, and then also only add the font styles to the elements which have a font in them. Also, no specificity should be lost by switching.
Also makes sense. One of the goals of this patch was to modify as few lines as possible, and this was the simplest solution. Can always revisit more exacting CSS later.
Menu Bar with overridden fonts