Make WordPress Core

Opened 11 years ago

Closed 11 years ago

Last modified 10 years ago

#35960 closed defect (bug) (fixed)

Remove excess padding from .nav-tab-wrapper

Reported by: ericdaams Owned by: ocean90
Priority: normal Milestone: 4.5
Component: Administration Version: 4.6
Severity: normal Keywords: has-patch has-screenshots
Cc: Focuses: ui, administration

Description (last modified by ocean90)

When an H1 is used for tabs with .nav-tab-wrapper, there is excess padding between the tabs & border.

Noted this issue with the Settings pages of the following plugins, but it will be the case with any other plugin that uses an H1 on the .nav-tab-wrapper:

  • Easy Digital Downloads
  • Charitable
  • Give

If there is an accessibility/semantic reason for not using an H1 on the .nav-tab-wrapper, I will happily change this in Charitable (my plugin), but I think a small patch here wouldn't hurt to account for plugins that don't update.

Likely related to #33559

Attachments (3)

Charitable Settings H1 UI bug.png​ (61.5 KB ) - added by ericdaams 11 years ago.
Excess padding in Charitable settings
Easy Digital Downloads Settings H1 UI bug.png​ (76.4 KB ) - added by ericdaams 11 years ago.
Excess padding in Easy Digital Downloads settings
35960.1.diff​ (380 bytes ) - added by ericdaams 11 years ago.

Download all attachments as: .zip

Change History (14)

@ericdaams
11 years ago

Excess padding in Charitable settings

@ericdaams
11 years ago

Excess padding in Easy Digital Downloads settings

@ericdaams
11 years ago

#1 in reply to: ↑ description @ericdaams
11 years ago

  • Keywords has-patch added

This is a broader issue actually. It also applies to h2.nav-tab-wrapper when the tabs are inside a .wrap. My patch resolves both cases.

#2 @ericdaams
11 years ago

  • Summary Remove excess padding from h1.nav-tab-wrapper → Remove excess padding from .nav-tab-wrapper

#3 @WPCharitable
11 years ago

  • Keywords has-screenshots added

#4 @ocean90
11 years ago

  • Focuses accessibility removed
  • Milestone Awaiting Review → 4.5
  • Owner set to ocean90
  • Status new → accepted

#5 @ocean90
11 years ago

  • Description modified (diff)

#6 @ocean90
11 years ago

  • Resolution → fixed
  • Status accepted → closed

In 37073:

Common CSS: Reset bottom padding for .nav-tab-wrapper.

Props ericdaams.
Fixes #35960.

#7 @afercia
11 years ago

Not arguing about the CSS fix, I'm all for it :) Worth noting we shouldn't encourage the usage of the H1 for the navigation tabs. The main H1 is meant to give an immediate feedback and context about "what" a page is about. Not so ideal for accessibility having a series of links as H1.
We've recently discussed the navigation tabs in the accessibility team weekly meeting, hopefully we'll try to come up with a new idea and proposal. Also, sorry we've missed this ticket :)

#8 @ericdaams
11 years ago

Thanks for the feedback @afercia. In a situation where there is no primary page header above the navigation tabs, what should be the preferred element to use for the navigation tabs? Current CSS is geared towards this being an h1, h2 or h3; my understanding is that you shouldn't skip headers.

#9 @afercia
11 years ago

@ericdaams personally, I'd consider to add a h1 heading before the nav tabs :) ideally, the nav tabs should be just links in a list, like a navigation menu. Maybe with a h2 before (can also be visually hidden), something like:

<h1>My beautiful plugin settings</h1>
<h2 class="screen-reader-text">Settings sections</h2>
<ul>links list</ul>

But this would require some custom CSS. As said, we're considering to propose to change this UI component, we should also consider ARIA roles and (maybe) HTML5 semantic elements. Hopefully, we'll come up with a proposal in the next months :)

#10 @ericdaams
11 years ago

Thanks @afercia for the feedback! Really appreciate it. Look forward to seeing that proposal.

#11 @ramiy
10 years ago

Related: #37257

Note: See TracTickets for help on using tickets.