Make WordPress Core

Opened 13 years ago

Closed 13 years ago

#15727 closed defect (bug) (fixed)

Theme CSS and admin bar list item conflicts

Reported by: greenshady's profile greenshady Owned by:
Milestone: 3.1 Priority: normal
Severity: normal Version: 3.1
Component: Administration Keywords: has-patch
Focuses: Cc:

Description

Currently, if a theme adds CSS to basic ul or li elements, it might overwrite the admin bar. I can see this being a big issue with themes.

If looking at the attached screenshot, you will see a blue bullet and extra padding. This is caused by this CSS in a theme's style.css file:

ul li {
	padding-left: 10px;
	background: url(images/bullet.png) no-repeat 0 11px;
	}

This only seems to mess with the top level of the menu.

I imagine issues like this will be fairly common. We just need to make the CSS for the admin bar more specific so that general CSS code like this doesn't cause conflicts.

Attachments (2)

admin-bar-ul-conflicts.png (3.7 KB) - added by greenshady 13 years ago.
15727.diff (388 bytes) - added by duck_ 13 years ago.

Download all attachments as: .zip

Change History (6)

#1 @duck_
13 years ago

  • Keywords has-patch added
  • Milestone changed from Awaiting Review to 3.1

The problem being that the admin bar styles don't specifically set these values to 0/none, so even when the #wpadminbar ID is matched as the most important style for the bar it doesn't actually override. Patch attached worked in the following test placed at the bottom of Twenty Ten:

ul li {
	margin-top: 5px;
	padding-left: 10px;
	list-style: disc outside none;
	}

Probably want to check there aren't any other styles that need to be overridden for #wpadminbar

@duck_
13 years ago

#2 @nacin
13 years ago

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

(In [16811]) Better reset for ul and li in the admin bar. props duck_, fixes #15727.

#3 follow-up: @nacin
13 years ago

  • Resolution fixed deleted
  • Status changed from closed to reopened

Probably want to check there aren't any other styles that need to be overridden for #wpadminbar

Would be good to do a sweep.

#4 in reply to: ↑ 3 @ocean90
13 years ago

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

Replying to nacin:

Probably want to check there aren't any other styles that need to be overridden for #wpadminbar

Would be good to do a sweep.

Done with [16862] & [16875] and my patch on #15611.

Note: See TracTickets for help on using tickets.