WordPress.org

Make WordPress Core

Opened 7 years ago

Closed 7 years ago

Last modified 7 years ago

#30055 closed defect (bug) (wontfix)

Admin Bar overlapped header/content instead of pushing it down

Reported by: Sendoku Owned by:
Milestone: Priority: normal
Severity: normal Version: 4.0
Component: Toolbar Keywords:
Focuses: template Cc:

Description (last modified by SergeyBiryukov)

The admin bar for some reason is not pushing down content. This same issued occurred before here: #15613

Its essentially doing the same thing and is not cutting into the content rather than pushing it down. This does make it harder to develop themes as the site looks different loggedin/out.

Attachments (1)

screenshot.jpg (22.0 KB) - added by Sendoku 7 years ago.

Download all attachments as: .zip

Change History (8)

@Sendoku
7 years ago

#1 @DrewAPicture
7 years ago

  • Component changed from General to Toolbar
  • Focuses template added

#2 @obenland
7 years ago

Hi Sendoku, can you tell us what theme you noticed the issue with?

#3 @valendesigns
7 years ago

Is the theme header set to fixed by chance?

#4 follow-up: @SergeyBiryukov
7 years ago

  • Description modified (diff)

I've found that adding position: relative for body or html generally helps for issues like this.

Should we consider adding that to admin-bar.css? Would it cause any repercussions?

#5 in reply to: ↑ 4 @valendesigns
7 years ago

Replying to SergeyBiryukov:

I've found that adding position: relative for body or html generally helps for issues like this.

Should we consider adding that to admin-bar.css? Would it cause any repercussions?

In order to properly test that scenario we would need some offending code, but it seems likely it will solve it if it's a fixed or absolute position issue and the parent is not relative. I'll try and break it in a theme with various positioning of the header and see if your fix will work and if there are any obvious repercussion to adding it.

#6 @valendesigns
7 years ago

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

I don't think this is solvable from our end. The underlying issue, at least from my POV, is having a position: fixed header or navigation at top: 0, just like Twenty Fourteen which doesn't respect the admin bar unless you add a theme specific fix.

.admin-bar.masthead-fixed .site-header {
    top: 32px;
}

Without the theme making a specific change adding an arbitrary relative: position to body or html isn't going to do anything because both the admin and navigation will be set to a fixed position of top: 0.

There is a solution, but it's not backwards compatible, so not even a little bit viable. For the sake of completeness, the solution would be ...

.admin-bar { 
    margin-top: 32px;
}
.wpadminbar {
    top: -32px;
}

I'm going to close this as wontfix, for the reasons I just gave. However, if anyone else can think of a viable backwards compatible solution by all means please prove me wrong and reopen the ticket.

#7 @ocean90
7 years ago

  • Milestone Awaiting Review deleted
Note: See TracTickets for help on using tickets.